Reine Redaktionsrechte öffnen nicht mehr das Backend (0.25.1)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 4m6s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m20s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m17s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m18s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m10s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m41s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m44s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m59s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m51s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 4m6s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m20s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m17s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m18s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m10s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m41s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m44s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m59s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m51s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4d155457b8
commit
34d6cdbf1c
121 changed files with 371 additions and 318 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Support\Abilities;
|
||||
use App\Support\Avatars;
|
||||
use App\Support\Covers;
|
||||
use App\Support\Permissions\Permissions;
|
||||
|
|
@ -68,11 +69,22 @@ class User extends Authenticatable implements FilamentUser, HasAvatar
|
|||
return $this->canAccessAdmin();
|
||||
}
|
||||
|
||||
/**
|
||||
* Backend (/admin) nur für Rechte, die dort gepflegt werden. Wer nur Redaktionsrechte
|
||||
* hat (Beiträge schreiben, Seiten bearbeiten …), arbeitet vollständig im Portal.
|
||||
*/
|
||||
public function canAccessAdmin(): bool
|
||||
{
|
||||
$permissions = $this->permissions();
|
||||
if (! $this->is_active) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->is_active && ($permissions->global !== [] || $permissions->hasAnyObjectGrant());
|
||||
$permissions = $this->permissions();
|
||||
$abilities = app(Abilities::class);
|
||||
|
||||
return $permissions->isSuperuser()
|
||||
|| collect(array_keys($permissions->global))->merge(array_keys($permissions->objects))
|
||||
->contains(fn (string $ability) => $abilities->needsBackend($ability));
|
||||
}
|
||||
|
||||
public function permissions(): PermissionSet
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue