This class is responsible for the relationship between permissions, users and surveys.
It could be handled as a specific permissions system for surveys.
package | Default |
---|
__construct(\Survey $survey,boolean $userControlSameGroupPolicy)
addUserGroupToSurveyPermissions(integer $userGroupId): integer
This includes that the users get the permission 'read' for this survey.
integer
the user group id
integer
amount of users from the given group added
addUserToSurveyPermission(integer $userid): boolean
integer
the userid
boolean
true if user could be added, false otherwise
deleteUserPermissions(integer $userId): integer
integer
integer
number of deleted permissions, 0 means nothing has been deleted
getSurveyUserGroupList(): array
A user group could be added to survey permissions if there is at least one user in the group which has not already been added to survey permissions of this survey.
array
containing ['ugid'] and ['name']
getSurveyUserList(): array
array
getTooltipAllPermissions(integer $userId,string $permissioName,array $basicPermissionDetails): array
integer
the user id
string
permission name (e.g. 'assessments' or 'quotas')
array
array with basic information about a permission (e.g. permission name, single permissions(CRUD) etc.)
array
structure is ['hasPermissions'] --> if user has at least one permission entity ['allPermissions'] --> does the user has ALL possible permission entities ['permissionCrudArray'] --> array with permission entities the user has
getUserGroupNames(integer $userid,boolean $usercontrolSameGroupPolicy): array
integer
boolean
array
names of user groups, or empty array
getUserIdsWithSurveyPermissions(): array
array
getUserPermissionCriteria(): \CDbCriteria
\CDbCriteria
getUsersSurveyPermissionEntity(integer $userid,string $permission): \Permission|null
integer
the userid
string
the survey permission (e.g. 'assessments', 'responses')
\Permission|null
getUsersSurveyPermissions(): array<mixed,\Permission>
saveUserGroupPermissions(integer $userGroupId,array $permissions): boolean
Throws |
|
---|
integer
array
boolean
saveUserPermissions(integer $userId,array $permissions): boolean
integer
array
boolean
true if all permissions could be saved, false otherwise
userControlSameGroupPolicy :boolean
var |
---|
boolean