Setting up User Role Permissions for Custom Plugins

We're upgrading our support forum. Replies are currently closed. Please view our Documentation and FAQ using the menu above.

We are just now finishing up some of our first Plugins/Modules that are specific to our business.  How can we implement user roles in our custom modules?

Is there a way we can add roles to the User Roles edit screens?

Yes, within the custom plugin you can simply do a call like this:

if(module_whatever::can_i(‘view’,’Something’){
// user has ‘view’ access to ‘Something’ under the ‘whatever’ module
}

if(module_whatever::can_i(‘edit’,’Something’){
// user has ‘edit’ access to ‘Something’ under the ‘whatever’ module
}

if(module_whatever::can_i(‘create’,’Something’){
// user has ‘create’ access to ‘Something’ under the ‘whatever’ module
}

if(module_whatever::can_i(‘delete’,’Something’){
// user has ‘delete’ access to ‘Something’ under the ‘whatever’ module
}

after doing this and trying to access the custom module, these new security options will become available for selection under settings > user roles.

The forum ‘Custom Development’ is closed to new topics and replies.

patchworksSetting up User Role Permissions for Custom Plugins