Changeset 3714309
- Timestamp:
- 09/26/2026 01:53:30 PM (4 weeks ago)
- Location:
- itx-userops/trunk
- Files:
-
- 3 edited
-
itx-userops.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
src/Modules/Roles/Writer.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
itx-userops/trunk/itx-userops.php
r3714287 r3714309 4 4 * Plugin URI: https://itxuserops.com 5 5 * Description: User management, login activity, sessions & audit log — one unified admin console for WordPress users. 6 * Version: 2.2. 16 * Version: 2.2.2 7 7 * Requires at least: 6.6 8 8 * Requires PHP: 7.4 … … 19 19 defined( 'ABSPATH' ) || exit; 20 20 21 define( 'ITXUO_VERSION', '2.2. 1' );21 define( 'ITXUO_VERSION', '2.2.2' ); 22 22 define( 'ITXUO_PATH', plugin_dir_path( __FILE__ ) ); 23 23 define( 'ITXUO_URL', plugin_dir_url( __FILE__ ) ); -
itx-userops/trunk/readme.txt
r3714287 r3714309 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 2.2. 17 Stable tag: 2.2.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 218 218 219 219 == Changelog == 220 221 = 2.2.2 = 222 * Fixed: "Duplicate Administrator" was refused with "You cannot grant access you do not have yourself" on most sites. WordPress switches some of the administrator's capabilities off at run time (file editing when DISALLOW_FILE_EDIT is set, the Links manager, unfiltered uploads), and WooCommerce stores per-item ones, and the role editor read all of those as not held. Capabilities your own role grants can now be copied. No other change. 220 223 221 224 = 2.2.1 = … … 271 274 == Upgrade Notice == 272 275 276 = 2.2.2 = 277 Fixes "Duplicate Administrator" in the role editor, which was refused on most sites. 278 273 279 = 2.2.1 = 274 280 Fixes 2.2.0, which was published without two of its files and stopped sites loading. Update now. -
itx-userops/trunk/src/Modules/Roles/Writer.php
r3639234 r3714309 162 162 * and it already accounts for the network boundary. 163 163 * 164 * "Hold" includes what the user's own roles grant ON PAPER, and that is what 165 * made "Duplicate Administrator" work again (2.2.2). WordPress switches some 166 * capabilities off for everyone at run time — edit_plugins, edit_themes and 167 * edit_files under DISALLOW_FILE_EDIT, manage_links when the Links manager 168 * is off, unfiltered_upload unless ALLOW_UNFILTERED_UPLOADS — and WooCommerce 169 * stores per-item capabilities (edit_product, read_shop_order) that 170 * current_user_can() can only answer for a specific item. The administrator 171 * role holds all of them, current_user_can() said no to all of them, and the 172 * ceiling refused to copy the role it was looking at. Granting what your own 173 * role already grants cannot lift anyone above you: the same run-time switch 174 * applies to whoever receives it. 175 * 164 176 * @param string[] $adding Capabilities about to be granted. 165 177 * @return true|\WP_Error … … 172 184 $refused = array(); 173 185 186 $user = wp_get_current_user(); 187 174 188 foreach ( $adding as $cap ) { 175 if ( ! current_user_can( $cap ) ) { 189 // On paper first: it answers without asking WordPress to map a 190 // per-item capability with no item, which it reports as an error. 191 $on_paper = $user instanceof \WP_User && $user->exists() && ! empty( $user->allcaps[ (string) $cap ] ); 192 193 if ( ! $on_paper && ! current_user_can( $cap ) ) { 176 194 $refused[] = $cap; 177 195 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)