DrQuincy Posted January 19, 2022 Share Posted January 19, 2022 I have a simple Process installed that displays some dynamic HTML that I want to allow a logged in person to view who doesn't have the superuser role. Is this possible? I am assuming because a class that extends Process is used by the admin template this doesn't happen by default. How do I did it? I have tried adding 'permission' => 'content-manager' to getModuleinfo() by when I access the page as a content-manager user it just redirects to the site tree. Thanks. ? Link to comment Share on other sites More sharing options...
Jan Romero Posted January 19, 2022 Share Posted January 19, 2022 3 hours ago, DrQuincy said: 'content-manager' Is this a Permission or a Role? You have to put a Permission. 1 Link to comment Share on other sites More sharing options...
DrQuincy Posted January 19, 2022 Author Share Posted January 19, 2022 Ah sorry, I was using “permission” and “role” interchangeably. You're right, I want users with the role content-manager to be able to view an admin page that has a custom Process class I wrote. Is this possible without making them a superuser? Link to comment Share on other sites More sharing options...
rick Posted January 19, 2022 Share Posted January 19, 2022 N/A 2 Link to comment Share on other sites More sharing options...
Jan Romero Posted January 19, 2022 Share Posted January 19, 2022 Well, yeah, but you can’t give the Process to a Role. You can give it to a Permission and add that Permission to the Role content-manager. 1 Link to comment Share on other sites More sharing options...
DrQuincy Posted January 19, 2022 Author Share Posted January 19, 2022 Thanks, but sorry to have mislead you, I actually want to restrict by role, not permission. ? Link to comment Share on other sites More sharing options...
DrQuincy Posted January 19, 2022 Author Share Posted January 19, 2022 2 minutes ago, Jan Romero said: Well, yeah, but you can’t give the Process to a Role. You can give it to a Permission and add that Permission to the Role content-manager. Thanks, does role not come into it then? I.e. can content-manager get at it without being given permission to view the admin template? Link to comment Share on other sites More sharing options...
Jan Romero Posted January 19, 2022 Share Posted January 19, 2022 The Role comes into it because it’s what connects the Permission to a User ? A User has one or more Roles, a Role has one or more Permissions which it grants to those Users. So if you create a Permission for your Process and give it to only one Role, “content-manager”, only Users with that Role will be able to access the Process (apart from superusers who can access anything, I guess). I don’t know, it’s difficult to come up with a succinct example, but basically you can use roles to group users by their jobs and permissions to define what activities those jobs entail. Then if you need someone to do two jobs, you just give them two roles. If a role needs to do more things, you give the role more permissions (instead of going through the users separately). 1 Link to comment Share on other sites More sharing options...
DrQuincy Posted January 19, 2022 Author Share Posted January 19, 2022 Thanks for the explanation, Jan. And, yes, that makes sense as to the difference between roles and permissions. I have created the permission tasks-list-access and assigned it to the role content-manager. I have then added 'permission' => 'tasks-list-access' to my Process class but it hasn't made a difference. Am I missing something? I refreshed the module and it worked. Hoorah! Thanks very much for your help. ? 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now