It looks like you're new here. If you want to get involved, click one of these buttons!
I am trying to make a custom page (Custom Page plugin) only visible to a specific set of roles. Otherwise, it should show the 'no permission' page.
Whats the best way to go about this?
in addition you can find out a bit more here;
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
you should check for a permission not a role. assign users to roles, provide permissions to roles.
this statement checks whether the user has Plugins.Pockets.Manage permission. if not it bounces out.
you just need to echo back the message you wish if they dont have the appropriate permission. you can find examples of this type of check in many plugins and controllers. just do a search on check permission.