-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Roles #135
Comments
I also have the same problem. Is it possible to solve? |
hi. any solution? thanks |
No solution for this plugin |
Hi All. This is my first submission in Github. Please feel free to remove if not appropriate here. A way to handle this is to put below code in functions.php or similar. function my_aal_init_caps( $caps ) {
// error_log('caps: '. var_export($caps, true)); // Inspect the array
$user = wp_get_current_user();
if ( in_array( 'administrator', ( array ) $user->roles ) ) {
// We create a bogus Admin role for our customers, they think they are superadmins but we restrict their caps.
array_push( $caps['administrator'], 'admin' );
} else {
// Allow the bogus Admin role to inspect logs including their own but not superadmin.
$caps['administrator'][0] = 'admin';
// Just for shows, authors not allowed.
unset( $caps['author'] );
}
return $caps;
}
add_filter( 'aal_init_caps', 'my_aal_init_caps' ); |
Fixed by e56cd2a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We use a plugin to add custom roles. I notice that these roles are not in the Roles dropdown. Is there a hook to add them?
Thanks,
The text was updated successfully, but these errors were encountered: