Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Hello! 👋 Thanks for opening this pull request! Please check out our contributing guidelines. We appreciate you taking the initiative to contribute to this project. Contributing isn't limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation. Here are some useful Composer commands to get you started:
To run a single Behat test, you can use the following command: # Run all tests in a single file
composer behat features/some-feature.feature
# Run only a specific scenario (where 123 is the line number of the "Scenario:" title)
composer behat features/some-feature.feature:123You can find a list of all available Behat steps in our handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Fixes #88
wp role create <role-key> <role-name> --clone=<role>grants every capability of the source role, including the ones the source role explicitly denies:create()keeps onlyarray_keys( $role_obj->capabilities )and then callsadd_cap( $cap )for each key.add_cap()defaults$granttotrue, so a denied capability on the source role becomes a granted one on the clone.create()now passes the source role's full capabilities array, with its grant values, toadd_role( $role_key, $role_name, $capabilities )and drops theadd_cap()loop. The success messages and the order of the cloned capabilities stay the same. Creating a role without--clonestill passes an empty array, which is theadd_role()default.Testing
Adds a scenario to
features/roles.feature, after "Cloning a role". It deniesspectateonauthor, clonesauthorintoreporter, and checks thatwp cap list reporter --show-grantlistsspectate,falseand still listsupload_files,true.wp cap list reporter --show-grantlistsspectate,true(WordPress 7.1.4, MySQL 8.4).features/roles.feature(5 scenarios) andfeatures/cap.feature(1 scenario) pass on WordPress 7.1.4, MySQL 8.4.src/Role_Command.php. The linter, Gherkin lint and PHPStan pass.AI assistance: I used Claude Code to find this and write the change; I reviewed and ran everything myself.
Summary by CodeRabbit