Final Class Yiisoft\Rbac\Db\TransactionalManagerDecorator
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Public Methods
Method Details
| public mixed __construct ( \ | ||
| $manager | \ |
|
| $database | \ |
|
public function __construct(
private readonly ManagerInterface $manager,
private readonly ConnectionInterface $database,
) {}
| public \ | ||
| $parentName | string | |
| $childName | string | |
public function addChild(string $parentName, string $childName): ManagerInterface
{
$this->manager->addChild($parentName, $childName);
return $this;
}
| public \ | ||
| $permission | \ |
|
public function addPermission(Permission $permission): ManagerInterface
{
$this->manager->addPermission($permission);
return $this;
}
| public \ | ||
| $role | \ |
|
public function addRole(Role $role): ManagerInterface
{
$this->manager->addRole($role);
return $this;
}
| public \ | ||
| $itemName | string | |
| $userId | integer|\ |
|
| $createdAt | ?int | |
public function assign(string $itemName, int|Stringable|string $userId, ?int $createdAt = null): ManagerInterface
{
$this->manager->assign($itemName, $userId, $createdAt);
return $this;
}
| public boolean canAddChild ( string $parentName, string $childName ) | ||
| $parentName | string | |
| $childName | string | |
public function canAddChild(string $parentName, string $childName): bool
{
return $this->manager->canAddChild($parentName, $childName);
}
| public array getChildRoles ( string $roleName ) | ||
| $roleName | string | |
public function getChildRoles(string $roleName): array
{
return $this->manager->getChildRoles($roleName);
}
| public array getDefaultRoleNames ( ) |
public function getDefaultRoleNames(): array
{
return $this->manager->getDefaultRoleNames();
}
| public array getDefaultRoles ( ) |
public function getDefaultRoles(): array
{
return $this->manager->getDefaultRoles();
}
| public ?\ |
public function getGuestRole(): ?Role
{
return $this->manager->getGuestRole();
}
| public ?string getGuestRoleName ( ) |
public function getGuestRoleName(): ?string
{
return $this->manager->getGuestRoleName();
}
| public array getItemsByUserId ( integer|\ | ||
| $userId | integer|\ |
|
public function getItemsByUserId(int|Stringable|string $userId): array
{
return $this->manager->getItemsByUserId($userId);
}
| public ?\ | ||
| $name | string | |
public function getPermission(string $name): ?Permission
{
return $this->manager->getPermission($name);
}
| public array getPermissionsByRoleName ( string $roleName ) | ||
| $roleName | string | |
public function getPermissionsByRoleName(string $roleName): array
{
return $this->manager->getPermissionsByRoleName($roleName);
}
| public array getPermissionsByUserId ( integer|\ | ||
| $userId | integer|\ |
|
public function getPermissionsByUserId(int|Stringable|string $userId): array
{
return $this->manager->getPermissionsByUserId($userId);
}
| public ?\ | ||
| $name | string | |
public function getRole(string $name): ?Role
{
return $this->manager->getRole($name);
}
| public array getRolesByUserId ( integer|\ | ||
| $userId | integer|\ |
|
public function getRolesByUserId(int|Stringable|string $userId): array
{
return $this->manager->getRolesByUserId($userId);
}
| public array getUserIdsByRoleName ( string $roleName ) | ||
| $roleName | string | |
public function getUserIdsByRoleName(string $roleName): array
{
return $this->manager->getUserIdsByRoleName($roleName);
}
| public boolean hasChild ( string $parentName, string $childName ) | ||
| $parentName | string | |
| $childName | string | |
public function hasChild(string $parentName, string $childName): bool
{
return $this->manager->hasChild($parentName, $childName);
}
| public boolean hasChildren ( string $parentName ) | ||
| $parentName | string | |
public function hasChildren(string $parentName): bool
{
return $this->manager->hasChildren($parentName);
}
| public \ | ||
| $parentName | string | |
| $childName | string | |
public function removeChild(string $parentName, string $childName): ManagerInterface
{
$this->manager->removeChild($parentName, $childName);
return $this;
}
| public \ | ||
| $parentName | string | |
public function removeChildren(string $parentName): ManagerInterface
{
$this->manager->removeChildren($parentName);
return $this;
}
| public \ | ||
| $name | string | |
public function removePermission(string $name): ManagerInterface
{
$this->manager->removePermission($name);
return $this;
}
| public \ | ||
| $name | string | |
public function removeRole(string $name): ManagerInterface
{
$this->manager->removeRole($name);
return $this;
}
| public \ | ||
| $itemName | string | |
| $userId | integer|\ |
|
public function revoke(string $itemName, int|Stringable|string $userId): ManagerInterface
{
$this->manager->revoke($itemName, $userId);
return $this;
}
| public \ | ||
| $userId | integer|\ |
|
public function revokeAll(int|Stringable|string $userId): ManagerInterface
{
$this->manager->revokeAll($userId);
return $this;
}
| public \ | ||
| $roleNames | Closure|array | |
public function setDefaultRoleNames(Closure|array $roleNames): ManagerInterface
{
$this->manager->setDefaultRoleNames($roleNames);
return $this;
}
| public \ | ||
| $name | ?string | |
public function setGuestRoleName(?string $name): ManagerInterface
{
$this->manager->setGuestRoleName($name);
return $this;
}
| public \ | ||
| $name | string | |
| $permission | \ |
|
public function updatePermission(string $name, Permission $permission): ManagerInterface
{
$manager = $this->manager;
$this->database->transaction(static fn() => $manager->updatePermission($name, $permission));
return $this;
}
| public \ | ||
| $name | string | |
| $role | \ |
|
public function updateRole(string $name, Role $role): ManagerInterface
{
$manager = $this->manager;
$this->database->transaction(static fn() => $manager->updateRole($name, $role));
return $this;
}
| public boolean userHasPermission ( integer|string|\ | ||
| $userId | integer|string|\ |
|
| $permissionName | string | |
| $parameters | array | |
public function userHasPermission(
int|string|Stringable|null $userId,
string $permissionName,
array $parameters = [],
): bool {
return $this->manager->userHasPermission($userId, $permissionName, $parameters);
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.