RoleService Class


Service layer for Role objects.

public static class RoleService
System.Object → RoleService


AdministratorsId The Id of the Administrators role (-1).
CreatorsId The Id of the Creators role (-2).
ExternalId The Id of the External role (-3).
InternalId The Id of the Internal role (-4).


AddMember(Int32, Nullable) Adds a User to the specified Role.
Delete(Int32, Boolean) Permanently deletes a Role object from the repository.
Get(IEnumerable, Boolean) Gets a list of Role objects from the repository.
Get(Int32, Boolean) Gets a Role object from the repository.
Get(String, Boolean) Gets a Role object from the repository.
GetMembers(Int32, UserQuery) Gets the members of the specified Role.
GetRolesForUser(Int32, Boolean) Gets the Roles that the User is a member of.
Insert(Role) Inserts a Role object into the repository.
RemoveMember(Int32, Nullable) Removes a User from the specified Role.
Restore(Int32) Restores a trashed Role, i.e. clears the IsTrashed flag.
Search(RoleQuery) Performs a search according to the specified RoleQuery object.
Trash(Int32) Trashes a Role, i.e. sets the IsTrashed flag.
Update(Role) Updates an existing Role.