Developer forum

Forum » CMS - Standard features » Restrict access to only non-logged-in users

Restrict access to only non-logged-in users

Siv-Renate Hansen
Siv-Renate Hansen

I have a menu item, Log in, which I only want to be visible to non-logged-in users.

The item is a page, and is rendered in a menu context.

When I put access restrictions on the item, it doesn't work.

The group everyone is allowed access

The group customers (logged in users) are denied access to this element

A single user (test_selger) is also denied. This is my test account to see if this is working.

But no. What am I missing here?



Morten Bengtson Dynamicweb Employee
Morten Bengtson
This post has been marked as an answer

I can see that you are using the old permission model and I'm not sure if you can use that to accomplish what you want (see alternative below).
If the "Everyone" group is allowed access then it means that both anonymous and authenticated users are allowed access.
Instead you can try to only deny access for the "Customers" group.

When using the new permission model you can just select the "None" permission for the system role "Authenticated users (frontend)".

Alternatively you can modify your template to check if the user is logged in or not and then show/hide menu items based on that.

Best regards,

Votes for this answer: 1
Siv-Renate Hansen
Siv-Renate Hansen

Thanks. If I activate the new permission model, can I deactivate and reverse it again if it works in unexpected ways?

Martin Vang Dynamicweb Employee
Martin Vang

Yes, if you deactive the new permission model, you can go back to the old model.

Siv-Renate Hansen
Siv-Renate Hansen

I activated it, and now I'm not able to manage one of my sites in the backend. I cannot find any places where to set restrictions on sites.


You must be logged in to post in the forum