Hi there,
Thank you for the suggestion. I created an issue for this and will evaluate for this option. However, for the time being, you could add the capability to different user roles, if there aren’t many.
Cheers,
-
This reply was modified 5 years, 1 month ago by
meceware.
Hi
thank’s for your quick reply !
Indeed, I could add this capability to a role, that’s actually a good idea, event if in my use case, I would then need to create threes roles, which is not so nice neither.
I was more considering using a php condition, with current_user_can() that’s also very flexible but maybe less future proof (changes that may break the function output)
Cheers
Hi,
If you are familiar with PHP, you can add your own functions and use it via the plugin.
https://www.meceware.com/docs/block-permissions-for-gutenberg/#php-function
For example, first function would check for 2 capabilities, named CheckForCapability2, return true or false depending on current_user_can() function, then enter the function name there.
Yeah that is my backup plan 😉
Your plug-in just need true or false, for instance
function CheckForCapability2 () {
if (current_user_can('myCustomCap1') || current_user_can(myCustomCap2)){
retunr true;
}else {
retunr false;
}
}
And then type “CheckForCapability2” in the block php setting
Would that work, or is there any other needs ?
Thank’s
Yep, this should work just fine.
Ok excellent
Thank’s again for the plug-in and the quick support 🙂
forget about it’s working
-
This reply was modified 5 years, 1 month ago by
jbonlinea.
-
This reply was modified 5 years, 1 month ago by
jbonlinea.