pogidude Posted June 18, 2013 Posted June 18, 2013 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.
Wanze Posted June 18, 2013 Posted June 18, 2013 You know that you can define 'allowed template(s) for children' and 'allowed template(s) for parents' in the Family config from your template? 1
pogidude Posted June 18, 2013 Author Posted June 18, 2013 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.
ryan Posted June 20, 2013 Posted June 20, 2013 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.
pogidude Posted June 20, 2013 Author Posted June 20, 2013 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!
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