Roles via Nextcloud groups: sms-admin/manager/viewer + fix OAuth instance_uri
Deploy / deploy (push) Successful in 29s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Malek TellissiandClaude Sonnet 4.6 committed 2026-09-13 01:48:24 +02:00
1 parent fc4579c47d
commit 2937004118
16 files changed
+506 -5

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
<?php
namespace App\Traits;
use Illuminate\Database\Eloquent\Model;
trait EnforcesRoles
{
private static function canWrite(): bool
{
return auth()->user()?->hasAnyRole(['sms-admin', 'sms-manager']) ?? false;
}
public static function canCreate(): bool
{
return static::canWrite();
}
public static function canEdit(Model $record): bool
{
return static::canWrite();
}
public static function canDelete(Model $record): bool
{
return static::canWrite();
}
public static function canDeleteAny(): bool
{
return static::canWrite();
}
}