You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wp role create --clone grants capabilities that the source role denies #88
wp role create <role-key> <role-name> --clone=<role> copies every capability of the source role as granted, including the ones the source role explicitly denies:
$ wp cap add author spectate --grant=false
$ wp role create reporter Reporter --clone=author
$ wp cap list reporter --show-grant
upload_files,true
edit_posts,true
edit_published_posts,true
publish_posts,true
read,true
level_2,true
level_1,true
level_0,true
delete_posts,true
delete_published_posts,true
spectate,true
Role_Command::create() takes only array_keys( $role_obj->capabilities ) and then calls add_cap( $cap ) for each one. add_cap() defaults $grant to true, so the grant value of the source role is lost.
Expected: the clone has the same capabilities with the same grant values, so spectate,false.
Activity