Skip to content

Commit 5171897

Browse files
authored
[6.x] 6.24.1 (#14933)
2 parents 102ef28 + 982d45a commit 5171897

5 files changed

Lines changed: 123 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Release Notes
22

3+
## 6.24.1 (2026-07-03)
4+
5+
### What's fixed
6+
- Do not show a disabled cursor for start/end of pagination [#14921](https://github.com/statamic/cms/issues/14921) by @jaygeorge
7+
- Fix Bard link entry selector not showing pre-selected entry [#14917](https://github.com/statamic/cms/issues/14917) by @duncanmcclean
8+
- Fix required validation on empty code fields [#14918](https://github.com/statamic/cms/issues/14918) by @duncanmcclean
9+
- Fix fieldtype picker showing wrong list after switching blueprint modes [#14919](https://github.com/statamic/cms/issues/14919) by @duncanmcclean
10+
- Fix roles/groups select being empty for non-super users [#14889](https://github.com/statamic/cms/issues/14889) by @mynetx
11+
- Fix Glide route double slash for path-prefixed sites [#14908](https://github.com/statamic/cms/issues/14908) by @lwekuiper
12+
- Fix amber and default badge button hover background shade [#14924](https://github.com/statamic/cms/issues/14924) by @lazerg
13+
- Default the create user wizard super toggle to false [#14927](https://github.com/statamic/cms/issues/14927) by @stoffelio
14+
- Fix progress bar triggering excessive recursion [#14931](https://github.com/statamic/cms/issues/14931) by @jasonvarga
15+
- French translations [#14926](https://github.com/statamic/cms/issues/14926) by @ebeauchamps
16+
17+
18+
319
## 6.24.0 (2026-07-01)
420

521
### What's new

src/Fieldtypes/UserGroups.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class UserGroups extends Relationship
1818

1919
protected function authorizeItemData($id): bool
2020
{
21-
return User::current()->can('edit user groups');
21+
return User::current()->can('assign user groups');
2222
}
2323

2424
protected function toItemArray($id, $site = null)
@@ -35,7 +35,7 @@ protected function toItemArray($id, $site = null)
3535

3636
public function getIndexItems($request)
3737
{
38-
if (! User::current()->can('edit user groups')) {
38+
if (! User::current()->can('assign user groups')) {
3939
return collect();
4040
}
4141

src/Fieldtypes/UserRoles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class UserRoles extends Relationship
1818

1919
protected function authorizeItemData($id): bool
2020
{
21-
return User::current()->can('edit roles');
21+
return User::current()->can('assign roles');
2222
}
2323

2424
protected function toItemArray($id, $site = null)
@@ -47,7 +47,7 @@ public function preProcessIndex($data)
4747

4848
public function getIndexItems($request)
4949
{
50-
if (! User::current()->can('edit roles')) {
50+
if (! User::current()->can('assign roles')) {
5151
return collect();
5252
}
5353

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
namespace Tests\Fieldtypes;
4+
5+
use Illuminate\Http\Request;
6+
use PHPUnit\Framework\Attributes\Test;
7+
use Statamic\Facades\User;
8+
use Statamic\Fields\Field;
9+
use Statamic\Fieldtypes\UserGroups;
10+
use Tests\FakesRoles;
11+
use Tests\FakesUserGroups;
12+
use Tests\PreventSavingStacheItemsToDisk;
13+
use Tests\TestCase;
14+
15+
class UserGroupsTest extends TestCase
16+
{
17+
use FakesRoles;
18+
use FakesUserGroups;
19+
use PreventSavingStacheItemsToDisk;
20+
21+
#[Test]
22+
public function it_returns_empty_index_items_without_assign_user_groups_permission()
23+
{
24+
$this->actingAs($this->cpUserWithPermissions(['access cp']));
25+
26+
$items = $this->fieldtype()->getIndexItems(new Request);
27+
28+
$this->assertTrue($items->isEmpty());
29+
}
30+
31+
#[Test]
32+
public function it_returns_groups_in_index_items_with_assign_user_groups_permission()
33+
{
34+
$this->setTestUserGroups(['editors' => []]);
35+
$this->actingAs($this->cpUserWithPermissions(['access cp', 'assign user groups']));
36+
37+
$items = $this->fieldtype()->getIndexItems(new Request);
38+
39+
$this->assertContains('editors', $items->pluck('id'));
40+
}
41+
42+
private function fieldtype()
43+
{
44+
return (new UserGroups)->setField(new Field('test', ['type' => 'user_groups']));
45+
}
46+
47+
private function cpUserWithPermissions(array $permissions)
48+
{
49+
$this->setTestRoles(['test' => $permissions]);
50+
51+
return tap(User::make()->id(uniqid())->assignRole('test'))->save();
52+
}
53+
}

tests/Fieldtypes/UserRolesTest.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
namespace Tests\Fieldtypes;
4+
5+
use Illuminate\Http\Request;
6+
use PHPUnit\Framework\Attributes\Test;
7+
use Statamic\Facades\User;
8+
use Statamic\Fields\Field;
9+
use Statamic\Fieldtypes\UserRoles;
10+
use Tests\FakesRoles;
11+
use Tests\PreventSavingStacheItemsToDisk;
12+
use Tests\TestCase;
13+
14+
class UserRolesTest extends TestCase
15+
{
16+
use FakesRoles;
17+
use PreventSavingStacheItemsToDisk;
18+
19+
#[Test]
20+
public function it_returns_empty_index_items_without_assign_roles_permission()
21+
{
22+
$this->actingAs($this->cpUserWithPermissions(['access cp']));
23+
24+
$items = $this->fieldtype()->getIndexItems(new Request);
25+
26+
$this->assertTrue($items->isEmpty());
27+
}
28+
29+
#[Test]
30+
public function it_returns_roles_in_index_items_with_assign_roles_permission()
31+
{
32+
$this->actingAs($this->cpUserWithPermissions(['access cp', 'assign roles']));
33+
34+
$items = $this->fieldtype()->getIndexItems(new Request);
35+
36+
$this->assertContains('editor', $items->pluck('id'));
37+
}
38+
39+
private function fieldtype()
40+
{
41+
return (new UserRoles)->setField(new Field('test', ['type' => 'user_roles']));
42+
}
43+
44+
private function cpUserWithPermissions(array $permissions)
45+
{
46+
$this->setTestRoles(['test' => $permissions, 'editor' => []]);
47+
48+
return tap(User::make()->id(uniqid())->assignRole('test'))->save();
49+
}
50+
}

0 commit comments

Comments
 (0)