Enables scripted content fragments to use Roles Users
Methods
AddUserToRole
Add a user to a role
Velocity
#set($additionalInfoResponse = $core_v2_roleUsers.AddUserToRole("%{ RoleId = $roleIdArg, RoleName = $roleNameArg, UserId = $userIdArg, UserName = $userNameArg }"))
JavaScript
var additionalInfoResponse = core_v2_roleUsers.AddUserToRole({ RoleId: roleIdArg, RoleName: roleNameArg, UserId: userIdArg, UserName: userNameArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
options | Options | Set of optional parameters including: | Required | ||
RoleId | Int32 | Either RoleId or RoleName is required | Optional | ||
RoleName | String | Either RoleId or RoleName is required | Optional | ||
UserId | Int32 | Either UserId or Username is required | Optional | ||
UserName | String | Either UserId or UserName is required | Optional |
Returns
IsUserInRoles
Checks if a user is in 1 or more roles
Velocity
#set($booleanResponse = $core_v2_roleUsers.IsUserInRoles($userName, $roleNames))
JavaScript
var booleanResponse = core_v2_roleUsers.IsUserInRoles(userName, roleNames);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
userName | String | User Name | Required | ||
roleNames | IList of String | Role Names | Required |
Returns
Boolean
RemoveUserFromRole
Remove a user from a role
Velocity
#set($additionalInfoResponse = $core_v2_roleUsers.RemoveUserFromRole($roleId, "%{ UserId = $userIdArg, UserName = $userNameArg }"))
JavaScript
var additionalInfoResponse = core_v2_roleUsers.RemoveUserFromRole(roleId, { UserId: userIdArg, UserName: userNameArg });
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
roleId | Int32 | Role Id | Required | ||
options | Options | Set of optional parameters including: | Required | ||
UserId | Int32 | Either UserId or Username is required | Optional | ||
UserName | String | Either UserId or UserName is required | Optional |