Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Permission namespace problem

edited June 2012 in Vanilla 2.0 - 2.2

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?

Sign In or Register to comment.