Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line numberDiff line numberDiff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/Fieldtypes/UserGroups.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -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)
Expand All@@ -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();
}

Expand Down
4 changes: 2 additions & 2 deletions src/Fieldtypes/UserRoles.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -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)
Expand DownExpand Up@@ -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();
}

Expand Down
53 changes: 53 additions & 0 deletions tests/Fieldtypes/UserGroupsTest.php
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
<?php

namespace Tests\Fieldtypes;

use Illuminate\Http\Request;
use PHPUnit\Framework\Attributes\Test;
use Statamic\Facades\User;
use Statamic\Fields\Field;
use Statamic\Fieldtypes\UserGroups;
use Tests\FakesRoles;
use Tests\FakesUserGroups;
use Tests\PreventSavingStacheItemsToDisk;
use Tests\TestCase;

class UserGroupsTest extends TestCase
{
use FakesRoles;
use FakesUserGroups;
use PreventSavingStacheItemsToDisk;

#[Test]
public function it_returns_empty_index_items_without_assign_user_groups_permission()
{
$this->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();
}
}
50 changes: 50 additions & 0 deletions tests/Fieldtypes/UserRolesTest.php
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
<?php

namespace Tests\Fieldtypes;

use Illuminate\Http\Request;
use PHPUnit\Framework\Attributes\Test;
use Statamic\Facades\User;
use Statamic\Fields\Field;
use Statamic\Fieldtypes\UserRoles;
use Tests\FakesRoles;
use Tests\PreventSavingStacheItemsToDisk;
use Tests\TestCase;

class UserRolesTest extends TestCase
{
use FakesRoles;
use PreventSavingStacheItemsToDisk;

#[Test]
public function it_returns_empty_index_items_without_assign_roles_permission()
{
$this->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();
}
}
Loading