LimeSurvey API - Master branch

PermissionManager
in package

Service class for managing permission

Table of Contents

Properties

$app  : LSYii_Application
$model  : PermissionInterface
$request  : LSHttpRequest
$user  : LSWebUser

Methods

__construct()  : mixed
applyPermissions()  : bool
getCurrentPermission()  : bool
get the current permission To be mocked for test
getDbPermission()  : Permission|null
Get DB permission To be mocked for test
getNewEvent()  : PluginEvent
getNewPermission()  : Permission
getPermissionData()  : array<string|int, mixed>
get the permission data
setDbPermission()  : Permission
Set a new DB permission To be mocked for test
setMinimalEntityPermission()  : void
setPermissions()  : bool

Properties

Methods

applyPermissions()

public applyPermissions(int $userId, string $sPermission, array<string|int, mixed> $aSetPermission) : bool
Parameters
$userId : int
$sPermission : string
$aSetPermission : array<string|int, mixed>
Return values
bool

getCurrentPermission()

get the current permission To be mocked for test

public getCurrentPermission(string $sPermission, string $crud, int $userId) : bool
Parameters
$sPermission : string
$crud : string
$userId : int
Return values
bool

getDbPermission()

Get DB permission To be mocked for test

public getDbPermission(string $entityName, int $entityId, string|int $userId, string $sPermission) : Permission|null
Parameters
$entityName : string
$entityId : int
$userId : string|int
$sPermission : string
Return values
Permission|null

getPermissionData()

get the permission data

public getPermissionData([int|null $userId = null ]) : array<string|int, mixed>
Parameters
$userId : int|null = null

for this user id

Return values
array<string|int, mixed>

setDbPermission()

Set a new DB permission To be mocked for test

public setDbPermission(string $entityName, int $entityId, int $userId, string $sPermission) : Permission
Parameters
$entityName : string
$entityId : int
$userId : int
$sPermission : string
Return values
Permission

setMinimalEntityPermission()

public setMinimalEntityPermission(int $userId) : void
Parameters
$userId : int

setPermissions()

public setPermissions(int $userId) : bool
Parameters
$userId : int
Tags
todo

: Save Permission by POST value according to current user permssion

see
Permission::setPermissions
Return values
bool

        
On this page

Search results