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.

Permission namespace problem

edited June 2012 in Vanilla 2.0 - 2.8

I am writing my first plugin (I have Vanilla 2.0.18.4) but I have a little problem with permissions.

I have created some custom permissions and I want them to be editable separately for each category (like discussion and comment permissions).

I registered my custom permissions with the name "Plugins.MyPlugin.MyPermission" (because this seems to be the common practice in plugins). They appear in the /role/edit page, but not in the /vanilla/settings/editcategory page.

Apparently the problem is that the method GetAllowedPermissionNamespaces (see class.permissionmodel.php, line 211) parses names with strrpos, so it returns the namespace as "Plugins.MyPlugin", while the method GetJunctionPermissions uses strpos, so it reads the namespace as "Plugins" (line 270).

Shall I put my custom permissions in the Vanilla namespace? Otherwise, what is the clean "Vanilla way" to do this?

Tagged:
Sign In or Register to comment.