Jump to content

other permission hooks


pogidude
 Share

Recommended Posts

Other than the hookable methods in PagePermissions class, are there other permission methods I can hook into?

I'm looking to *override* what template is available (in the dropdown select) for the user to use when they create a new page.

Link to comment
Share on other sites

Yes. but that doesn't give the user *permission* to use the template.

It's just that you have the Page::addable(), Page::editable(), etc.. defined as method hooks in the PagePermissions class, then there is also User::hasPermission() which are also used but these aren't hookable.

Link to comment
Share on other sites

Other than the hookable methods in PagePermissions class, are there other permission methods I can hook into?

If there's a need for any method to be hookable, I can make it hookable. I didn't try to cover every possibility, instead preferring to make it easy to make hookable methods and them implementing them each time a need comes up. So if you want User::hasPermission to be hookable (for instance), just let me know and I'll make it hookable on the dev branch. 

Link to comment
Share on other sites

Thanks Ryan. I originally thought of asking for User::hasPermission() to be hookable for the module I've been working on but I think asking for ProcessPageAdd::getAllowedTemplates() would be more useful.

So, can I ask for ProcessPageAdd::getAllowedTemplates hook?

Thnaks!

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