Assign the existing site to one landlord so stommer.info can run tenancy.
Seebad 0.3 stays in this release. With a single landlord every host still reaches the default website. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
d9e52c4789
commit
8ebc1a3878
93 files changed
+2506
-112
No files matched your search
@@ -2,18 +2,16 @@
|
||||
|
||||
namespace App\Policies;
|
||||
|
||||
use App\Enums\UserRole;
|
||||
use App\Enums\Permission;
|
||||
use App\Models\User;
|
||||
|
||||
/**
|
||||
* Grants every ability to the roles listed in roles(). Administrators always have access.
|
||||
* Grants every ability that the current membership includes. The operator counts as administrator
|
||||
* of the landlord that is open. A new role is added on UserRole, not in each policy.
|
||||
*/
|
||||
abstract class RolePolicy
|
||||
{
|
||||
/**
|
||||
* @return list<UserRole>
|
||||
*/
|
||||
abstract protected function roles(): array;
|
||||
abstract protected function permission(): Permission;
|
||||
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
@@ -52,6 +50,6 @@ public function reorder(User $user): bool
|
||||
|
||||
protected function allows(User $user): bool
|
||||
{
|
||||
return $user->hasRole(UserRole::Admin, ...$this->roles());
|
||||
return (bool) $user->currentRole()?->grants($this->permission());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user