diff --git a/CHANGELOG.md b/CHANGELOG.md index 030ee21108a..8d04d9f2fe4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Release Notes +## 6.24.1 (2026-07-03) + +### What's fixed +- Do not show a disabled cursor for start/end of pagination [#14921](https://github.com/statamic/cms/issues/14921) by @jaygeorge +- Fix Bard link entry selector not showing pre-selected entry [#14917](https://github.com/statamic/cms/issues/14917) by @duncanmcclean +- Fix required validation on empty code fields [#14918](https://github.com/statamic/cms/issues/14918) by @duncanmcclean +- Fix fieldtype picker showing wrong list after switching blueprint modes [#14919](https://github.com/statamic/cms/issues/14919) by @duncanmcclean +- Fix roles/groups select being empty for non-super users [#14889](https://github.com/statamic/cms/issues/14889) by @mynetx +- Fix Glide route double slash for path-prefixed sites [#14908](https://github.com/statamic/cms/issues/14908) by @lwekuiper +- Fix amber and default badge button hover background shade [#14924](https://github.com/statamic/cms/issues/14924) by @lazerg +- Default the create user wizard super toggle to false [#14927](https://github.com/statamic/cms/issues/14927) by @stoffelio +- Fix progress bar triggering excessive recursion [#14931](https://github.com/statamic/cms/issues/14931) by @jasonvarga +- French translations [#14926](https://github.com/statamic/cms/issues/14926) by @ebeauchamps + + + ## 6.24.0 (2026-07-01) ### What's new diff --git a/src/Fieldtypes/UserGroups.php b/src/Fieldtypes/UserGroups.php index 52378b232e4..5d31cd631f7 100644 --- a/src/Fieldtypes/UserGroups.php +++ b/src/Fieldtypes/UserGroups.php @@ -18,7 +18,7 @@ class UserGroups extends Relationship protected function authorizeItemData($id): bool { - return User::current()->can('edit user groups'); + return User::current()->can('assign user groups'); } protected function toItemArray($id, $site = null) @@ -35,7 +35,7 @@ protected function toItemArray($id, $site = null) public function getIndexItems($request) { - if (! User::current()->can('edit user groups')) { + if (! User::current()->can('assign user groups')) { return collect(); } diff --git a/src/Fieldtypes/UserRoles.php b/src/Fieldtypes/UserRoles.php index 8b355c2f880..c7e8c88bf8f 100644 --- a/src/Fieldtypes/UserRoles.php +++ b/src/Fieldtypes/UserRoles.php @@ -18,7 +18,7 @@ class UserRoles extends Relationship protected function authorizeItemData($id): bool { - return User::current()->can('edit roles'); + return User::current()->can('assign roles'); } protected function toItemArray($id, $site = null) @@ -47,7 +47,7 @@ public function preProcessIndex($data) public function getIndexItems($request) { - if (! User::current()->can('edit roles')) { + if (! User::current()->can('assign roles')) { return collect(); } diff --git a/tests/Fieldtypes/UserGroupsTest.php b/tests/Fieldtypes/UserGroupsTest.php new file mode 100644 index 00000000000..ea4eb20405c --- /dev/null +++ b/tests/Fieldtypes/UserGroupsTest.php @@ -0,0 +1,53 @@ +actingAs($this->cpUserWithPermissions(['access cp'])); + + $items = $this->fieldtype()->getIndexItems(new Request); + + $this->assertTrue($items->isEmpty()); + } + + #[Test] + public function it_returns_groups_in_index_items_with_assign_user_groups_permission() + { + $this->setTestUserGroups(['editors' => []]); + $this->actingAs($this->cpUserWithPermissions(['access cp', 'assign user groups'])); + + $items = $this->fieldtype()->getIndexItems(new Request); + + $this->assertContains('editors', $items->pluck('id')); + } + + private function fieldtype() + { + return (new UserGroups)->setField(new Field('test', ['type' => 'user_groups'])); + } + + private function cpUserWithPermissions(array $permissions) + { + $this->setTestRoles(['test' => $permissions]); + + return tap(User::make()->id(uniqid())->assignRole('test'))->save(); + } +} diff --git a/tests/Fieldtypes/UserRolesTest.php b/tests/Fieldtypes/UserRolesTest.php new file mode 100644 index 00000000000..d3afd330d95 --- /dev/null +++ b/tests/Fieldtypes/UserRolesTest.php @@ -0,0 +1,50 @@ +actingAs($this->cpUserWithPermissions(['access cp'])); + + $items = $this->fieldtype()->getIndexItems(new Request); + + $this->assertTrue($items->isEmpty()); + } + + #[Test] + public function it_returns_roles_in_index_items_with_assign_roles_permission() + { + $this->actingAs($this->cpUserWithPermissions(['access cp', 'assign roles'])); + + $items = $this->fieldtype()->getIndexItems(new Request); + + $this->assertContains('editor', $items->pluck('id')); + } + + private function fieldtype() + { + return (new UserRoles)->setField(new Field('test', ['type' => 'user_roles'])); + } + + private function cpUserWithPermissions(array $permissions) + { + $this->setTestRoles(['test' => $permissions, 'editor' => []]); + + return tap(User::make()->id(uniqid())->assignRole('test'))->save(); + } +}