Default manager for permissions and user access for Hubleto project.
\Hubleto\Framework\PermissionsManager
Parent class | \Hubleto\Framework\Core |
Implements | \Hubleto\Framework\Interfaces\PermissionsManagerInterface |
Properties
grantAllPermissions
protected bool $grantAllPermissions
permissionsData
protected array $permissionsData
administratorRoles
public array $administratorRoles
administratorTypes
public array $administratorTypes
permission
protected string $permission
Methods
init
public init(): void
getPermission
public getPermission(): string
setPermission
public setPermission(string $permission): void
Parameters:
Parameter | Type | Description |
---|---|---|
$permission |
string |
createUserRoleModel
public createUserRoleModel(): \Hubleto\Framework\Model
createRolePermissionModel
public createRolePermissionModel(): \Hubleto\Framework\Model
DANGEROUS__grantAllPermissions
public DANGEROUS__grantAllPermissions(): void
revokeGrantAllPermissions
public revokeGrantAllPermissions(): void
loadAdministratorRoles
public loadAdministratorRoles(): array
loadAdministratorTypes
public loadAdministratorTypes(): array
expandPermissionGroups
public expandPermissionGroups(): void
set
public set(string $permission, int $idUserRole, bool $isEnabled): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$permission |
string | |
$idUserRole |
int | |
$isEnabled |
bool |
hasRole
public hasRole(int|string $role): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$role |
int|string |
grantedForRole
public grantedForRole(string $permission, int|string $userRole): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$permission |
string | |
$userRole |
int|string |
granted
public granted(string $permission, array $userRoles = [], int $userType): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$permission |
string | |
$userRoles |
array | |
$userType |
int |
checkPermission
public checkPermission(): void
check
public check(string $permission): void
Parameters:
Parameter | Type | Description |
---|---|---|
$permission |
string |
loadPermissions
public loadPermissions(): array<int,array<int,string>>
isAppPermittedForActiveUser
public isAppPermittedForActiveUser(\Hubleto\Framework\Interfaces\AppInterface $app): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$app |
\Hubleto\Framework\Interfaces\AppInterface |
Inherited methods
__construct
public __construct(): mixed
getServiceStatic
Shortcut for the dependency injection.
public static getServiceStatic(string $service): mixed
- This method is static. Parameters:
Parameter | Type | Description |
---|---|---|
$service |
string |
getService
[Description for getService]
public getService(string $service): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$service |
string |
env
Shortcut for the env service.
public env(): \Hubleto\Framework\Env
authProvider
Shortcut for the authentication service.
public authProvider(): \Hubleto\Framework\Interfaces\AuthInterface
db
Shortcut for the database service.
public db(): \Hubleto\Framework\Db
appManager
Shortcut for the app manager service.
public appManager(): \Hubleto\Framework\Interfaces\AppManagerInterface
router
Shortcut for the router service.
public router(): \Hubleto\Framework\Router
hookManager
Shortcut for the hook manager service.
public hookManager(): \Hubleto\Framework\HookManager
sessionManager
Shortcut for the session manager service.
public sessionManager(): \Hubleto\Framework\SessionManager
permissionsManager
Shortcut for the permissions manager service.
public permissionsManager(): \Hubleto\Framework\PermissionsManager
cronManager
Shortcut for the cron manager service.
public cronManager(): \Hubleto\Framework\CronManager
emailProvider
Shortcut for the email provider service.
public emailProvider(): \Hubleto\Framework\EmailProvider
config
Shortcut for the config service.
public config(): \Hubleto\Framework\Interfaces\ConfigManagerInterface
logger
Shortcut for the logger service.
public logger(): \Hubleto\Framework\Logger
locale
Shortcut for the locale service.
public locale(): \Hubleto\Framework\Locale
renderer
Shortcut for the renderer service.
public renderer(): \Hubleto\Framework\Renderer
translator
Shortcut for the translator service.
public translator(): \Hubleto\Framework\Interfaces\TranslatorInterface
getModel
[Description for getModel]
public getModel(string $model): \Hubleto\Framework\Models\Model
Parameters:
Parameter | Type | Description |
---|---|---|
$model |
string |
getController
[Description for getController]
public getController(string $controller): \Hubleto\Framework\Controller
Parameters:
Parameter | Type | Description |
---|---|---|
$controller |
string |
translate
Shorthand for core translate() function. Uses own language dictionary.
public translate(string $string, array $vars = []): string
Parameters:
Parameter | Type | Description |
---|---|---|
$string |
string | String to be translated |
$vars |
array |
Return Value:
Translated string.