You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- namespace App\Logic\User;
-
- use App\Codes\UserRole;
- use App\Models\Contract;
- use App\Models\User;
- use LogicException;
-
- class AdminUserManager extends UserManager
- {
- /**
- * @override
- */
- public function initForCreateAdmin(): static
- {
- $this->setUser(null);
- $this->initialized = true;
- return $this;
- }
-
- /**
- * @override
- */
- public function initForModifyAdmin(string|User $userId): static
- {
- $this->setUser($userId);
- $this->initialized = true;
- return $this;
- }
-
- /**
- * @override
- */
- public function initForCreate(string|Contract $contractId): static
- {
- throw new LogicException("不許可な関数アクセス");
- }
-
- /**
- * @override
- */
- public function initForModify(string|Contract $contractId, string|User $userId): static
- {
- throw new LogicException("不許可な関数アクセス");
- }
-
- protected function role(): UserRole
- {
- return UserRole::SUPER_ADMIN;
- }
- }
|