Jump to content
ottogal

Role with view permission only to pages of specific template

Recommended Posts

Hi all,

for testing pusposes I created one single page using an own template. Now I want to create a user with a special role which gives view access just for that single page, not to all the other pages with different templates.

The problem is that a new role always inherits the permissions of the guest role, hence view access to all pages.
To deny the view permission for the guest role for all the other templates (but not the homepage) is not a way because guest users should view the site normally.

Is there a simple solution for this case? I wouldn't like to install some complex module for this...

Thank you for ideas!

 

Share this post


Link to post
Share on other sites
12 hours ago, ottogal said:

To deny the view permission for the guest role for all the other templates (but not the homepage) is not a way because guest users should view the site normally.

This doesn't make much sense to me because the guest role should always be the most restricted role in the site. Making a role more restricted than the guest role isn't effective because the user could just log out and then access the protected content.

Share this post


Link to post
Share on other sites

Why not use $user->isLoggedin() for the new role in your template

  • Like 1

Share this post


Link to post
Share on other sites

Could you please explain by example what you are trying to achieve? At the moment I understood you like this:

Public users should be allowed to view all public pages, but not page XY

User foo should be allowed to view ONLY page XY (template bar) but not all public pages

12 hours ago, Robin S said:

This doesn't make much sense to me because the guest role should always be the most restricted role in the site.

Same here. Or I didn't understand you 🙂 

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, bernhard said:

Public users should be allowed to view all public pages, but not page XY

User foo should be allowed to view ONLY page XY (template bar) but not all public pages

Indeed, that was my aim originally - I didn't want infect you with my confusion...

In the meantime I decided to accept that user foo would have view (not edit) permission to all the public pages.
Important is that no guest user has access to the special page XY.

Many thanks for the help.

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...