Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Adding custom permissions.
kieronwiltshire
New
I require the ability to add my own permissions in a plugin I'm developing, I've searched the docs and found nothing. I'm hoping someone else will have the answer or perhaps a suggestion of where I can go from here, any help is much appreciated!
Thanks
-K
0
Comments
usually a good idea to look at examples in staff created plugins.
register permissions can be added via registerpermissions in PluginInfo array and when plugin is enabled the permissions are added to permission table and a checkbox appears in the roles for those permissions.
look at the flaggging plugin - it comes with core.
settingspermission controls who can access settings
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Hi @kieronwiltshire
Welcome to the community.
If you add this line to the $PluginInfo
'RegisterPermissions' => array('Plugins.Yourpluginname.Madeupnameofpermission'),
when you enable the plugin you will find a permissions setting for the plugin under each user.
@whu606 every user? Is there no way I can create permissions for "roles"?
read my comment. pls. it is correct.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@peregrine oh I'm so sorry, I didn't see your reply haha, silly me. I'll take a look, do you have any links to public repositories I could look at?
you mean the links in the documentation or the links at the top of the page.
staff plugins that come with core are in the download.
staff plugins that don't come with core are in the addons in vanilla - github.
non-staff also have examples in their add-ons
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@peregrine thanks a lot, that really helped!
Okay, this half answers my question.
My plan is to have a separate application that authenticates users over via SSO.
The idea was to check if the user had access to a specific permission from the external application. This means that it will not be a specific plugin.
So let me just explain it a little more...
The basis was to have an application developed in Laravel which is bridged with Vanilla forums, the goal was to then only allow users access to portions of the Laravel application if they had the permission.
How would I go about achieving this considering the application isn't a plugin?
not in my bailiwick
perhaps this will help
http://vanillaforums.org/search?adv=1&search=jsconnect&title=&author=x00,mtschirs,Bleistivt&cat=all&tags=&discussion_d=1&discussion_question=1&comment_c=1&comment_answer=1&within=1+day&date=
or this
http://vanillaforums.org/search?adv=1&search=sso&title=&author=x00,mtschirs,Bleistivt&cat=all&tags=&discussion_d=1&discussion_question=1&comment_c=1&comment_answer=1&within=1+day&date=
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
As I'm sure you realised, I meant each group or type of user...