0

I'm using the moduke Permissions by Term and I love it. It works great and my complete system is now build around it. But I ran into a certain case and I am wondering if this is even possible.

I want a node to be visible for Anonymous users but not for a logged in user with a certain role.

Is it possible to do this. Is it possible to hide content or deny access for a certain role to content that is available for Anonymous users?

2

If you give a permission to the Authenticated User role, you grant that permission to all other logged-in roles. It works like this because all logged-in users get that role.

However, as long as you don't grant a permission specifically to the Authenticated User role, you can pick and choose which individual logged-in roles to give the permission to. Then you can also give the permission to the Anonymous User role.

| improve this answer | |
  • 1
    That is why I proposed hook_node_access() to deny access, because this overrides all permissions granted through the Authenticated role and the Permission by Term module. – 4k4 Dec 13 '19 at 7:40
  • Very strange, because I tried this before I posted this question. I tried again this morning and...it works. Thanks! – Joost Dec 13 '19 at 8:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.