Deploy / deploy (push) Failing after 12s
- sms-admin: full access (create, edit, delete) - sms-manager: create and edit only, no delete - sms-viewer: read-only, all write buttons hidden - Apply EnforcesRolesInRelation trait to BatchesRelationManager - Revert Nextcloud OAuth credentials to env vars (OAUTH_CLOUDSPICESBLUE_*) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
560 B
PHP
27 lines
560 B
PHP
<?php
|
|
|
|
namespace App\Traits;
|
|
|
|
trait EnforcesRolesInRelation
|
|
{
|
|
public function canCreate(): bool
|
|
{
|
|
return auth()->user()?->hasAnyRole(['sms-admin', 'sms-manager']) ?? false;
|
|
}
|
|
|
|
public function canEdit(): bool
|
|
{
|
|
return auth()->user()?->hasAnyRole(['sms-admin', 'sms-manager']) ?? false;
|
|
}
|
|
|
|
public function canDelete(): bool
|
|
{
|
|
return auth()->user()?->hasRole('sms-admin') ?? false;
|
|
}
|
|
|
|
public function canDeleteAny(): bool
|
|
{
|
|
return auth()->user()?->hasRole('sms-admin') ?? false;
|
|
}
|
|
}
|