Jump to content

How can I make a Process available to a non-superuser?


DrQuincy
 Share

Recommended Posts

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

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

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

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).

  • Like 1
Link to comment
Share on other sites

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. ?

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...