Enables scripted content fragments to use Permissions
Methods
CheckPermission
CheckPermission Overload 1
Checks permission for a user.
Velocity
#set($permissionCheckResponse = $core_v3_permission.CheckPermission($permissionId, $userId, "%{ ApplicationId = $applicationIdArg, ApplicationTypeId = $applicationTypeIdArg, ContentId = $contentIdArg, ContentTypeId = $contentTypeIdArg }"))
JavaScript
var permissionCheckResponse = core_v3_permission.CheckPermission(permissionId, userId, { ApplicationId: applicationIdArg, ApplicationTypeId: applicationTypeIdArg, ContentId: contentIdArg, ContentTypeId: contentTypeIdArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
permissionId | Guid | Permission Id | Required | ||
userId | Int32 | User Id | Required | ||
options | Options | Set of optional parameters including: | Required | ||
ApplicationId | Guid | Application Id | Optional | ||
ApplicationTypeId | Guid | Application Type Id | Optional | ||
ContentId | Guid | Content Id | Optional | ||
ContentTypeId | Guid | Content Type Id | Optional |
CheckPermission Overload 2
Checks a site permission for a user.
Velocity
#set($permissionCheckResponse = $core_v3_permission.CheckPermission($permissionId, $userId))
JavaScript
var permissionCheckResponse = core_v3_permission.CheckPermission(permissionId, userId);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
permissionId | Guid | Permission Id | Required | ||
userId | Int32 | User Id | Required |
Returns
List
List permissions for a role
Velocity
#set($apiListResponse = $core_v3_permission.List($roleId, "%{ ApplicationId = $applicationIdArg, GroupId = $groupIdArg }"))
JavaScript
var apiListResponse = core_v3_permission.List(roleId, { ApplicationId: applicationIdArg, GroupId: groupIdArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
roleId | Int32 | Role Id | Required | ||
options | Options | Set of optional parameters including: | Required | ||
ApplicationId | Guid | Application Id | Optional | ||
GroupId | Int32 | Group Id | Optional |
Returns
Set
Sets a permission for a role
Velocity
#set($additionalInfoResponse = $core_v3_permission.Set($isAllowed, $roleId, $permissionId, "%{ ApplicationId = $applicationIdArg, GroupId = $groupIdArg }"))
JavaScript
var additionalInfoResponse = core_v3_permission.Set(isAllowed, roleId, permissionId, { ApplicationId: applicationIdArg, GroupId: groupIdArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
isAllowed | Boolean | Is Allowed | Required | ||
roleId | Int32 | Role Id | Required | ||
permissionId | Guid | Permission Id | Required | ||
options | Options | Set of optional parameters including: | Required | ||
ApplicationId | Guid | Application Id | Optional | ||
GroupId | Int32 | Group Id | Optional |