Interface IRoleService
The IRoleService interface describes a component responsible for facilitating the addition, removal, and retrieval of roles for social groups.
Namespace: EPiServer.Social.Groups.Core
Assembly: EPiServer.Social.Groups.Core.dll
Version: 1.5.4Syntax
public interface IRoleService
Methods
Add(Role)
Adds a new role for a group.
Declaration
Role Add(Role role)
Parameters
| Type | Name | Description |
|---|---|---|
| Role | role | Role to be added for a group |
Returns
| Type | Description |
|---|---|
| Role | Role which has been added |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Add<TExtension>(Role, TExtension)
Adds a role and its corresponding extension data
Declaration
Composite<Role, TExtension> Add<TExtension>(Role role, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Role | role | Role to be added |
| TExtension | extension | extension data to be added |
Returns
| Type | Description |
|---|---|
| Composite<Role, TExtension> | Composite of Role and extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
AddAsync(Role)
Asynchronously adds a new role for a group.
Declaration
Task<Role> AddAsync(Role role)
Parameters
| Type | Name | Description |
|---|---|---|
| Role | role | Role to be added for a group |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Role> | Role which has been added |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
AddAsync<TExtension>(Role, TExtension)
Asynchronously adds a role and its corresponding extension data
Declaration
Task<Composite<Role, TExtension>> AddAsync<TExtension>(Role role, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| Role | role | Role to be added |
| TExtension | extension | extension data to be added |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Composite<Role, TExtension>> | Composite of Role and extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Assign(RoleAssignment)
Assigns a role to a particular group member.
Declaration
void Assign(RoleAssignment assignment)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleAssignment | assignment | Describes the assignment of a role to a member |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| MemberDoesNotExistException | Thrown when the identified member does not exist. |
| RoleDoesNotExistException | Thrown when the identified role does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
AssignAsync(RoleAssignment)
Asynchronously assigns a role to a particular group member.
Declaration
Task AssignAsync(RoleAssignment assignment)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleAssignment | assignment | Describes the assignment of a role to a member |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| MemberDoesNotExistException | Thrown when the identified member does not exist. |
| RoleDoesNotExistException | Thrown when the identified role does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Get(Criteria<RoleFilter>)
Retrieves a page of roles as described by the specified criteria.
Declaration
ResultPage<Role> Get(Criteria<RoleFilter> criteria)
Parameters
| Type | Name | Description |
|---|---|---|
| Criteria<RoleFilter> | criteria | Criteria by which to filter roles |
Returns
| Type | Description |
|---|---|
| ResultPage<Role> | Page of roles |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| InvalidPageInfoException | Thrown when the page info is invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Get(RoleId)
Retrieves a role by its ID.
Declaration
Role Get(RoleId roleId)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | ID of role to be retrieved |
Returns
| Type | Description |
|---|---|
| Role | Role identified by the specified ID |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| RoleDoesNotExistException | Thrown when the identified role does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Get<TExtension>(CompositeCriteria<RoleFilter, TExtension>)
Retrieves a page of roles as described by the specified criteria. The retrieved roles are filtered by the type of their associated data.
Declaration
ResultPage<Composite<Role, TExtension>> Get<TExtension>(CompositeCriteria<RoleFilter, TExtension> criteria)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| CompositeCriteria<RoleFilter, TExtension> | criteria | Filters the result set of roles and their extension data |
Returns
| Type | Description |
|---|---|
| ResultPage<Composite<Role, TExtension>> | Page of roles and their corresponding extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type of data associated with the desired roles |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| InvalidPageInfoException | Thrown when the page info is invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Get<TExtension>(RoleId)
Gets a role and its corresponding extension data
Declaration
Composite<Role, TExtension> Get<TExtension>(RoleId roleId)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | ID of the role to be retrieved |
Returns
| Type | Description |
|---|---|
| Composite<Role, TExtension> | Composite of role and extension data for the specified ID |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| RoleDoesNotExistException | Thrown when the identified role does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
GetAsync(Criteria<RoleFilter>)
Asynchronously retrieves a page of roles as described by the specified criteria.
Declaration
Task<ResultPage<Role>> GetAsync(Criteria<RoleFilter> criteria)
Parameters
| Type | Name | Description |
|---|---|---|
| Criteria<RoleFilter> | criteria | Criteria by which to filter roles |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ResultPage<Role>> | Page of roles |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| InvalidPageInfoException | Thrown when the page info is invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
GetAsync(RoleId)
Asynchronously retrieves a role by its ID.
Declaration
Task<Role> GetAsync(RoleId roleId)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | ID of role to be retrieved |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Role> | Role identified by the specified ID |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| RoleDoesNotExistException | Thrown when the identified role does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
GetAsync<TExtension>(CompositeCriteria<RoleFilter, TExtension>)
Asynchronously retrieves a page of roles as described by the specified criteria. The retrieved roles are filtered by the type of their associated data.
Declaration
Task<ResultPage<Composite<Role, TExtension>>> GetAsync<TExtension>(CompositeCriteria<RoleFilter, TExtension> criteria)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| CompositeCriteria<RoleFilter, TExtension> | criteria | Filters the result set of roles and their extension data |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<ResultPage<Composite<Role, TExtension>>> | Page of roles and their corresponding extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension | Type of data associated with the desired roles |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| InvalidPageInfoException | Thrown when the page info is invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
GetAsync<TExtension>(RoleId)
Asynchronously gets a role and its corresponding extension data
Declaration
Task<Composite<Role, TExtension>> GetAsync<TExtension>(RoleId roleId)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | ID of the role to be retrieved |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Composite<Role, TExtension>> | Composite of role and extension data for the specified ID |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| RoleDoesNotExistException | Thrown when the identified role does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
IsAssigned(RoleAssignment)
Returns a boolean indicating whether a member has been assigned to a particular role.
Declaration
bool IsAssigned(RoleAssignment assignment)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleAssignment | assignment | Identifies the role assigment, which is to be verified |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the member has been assigned the role, false otherwise |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Role assignment is insufficient |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
IsAssignedAsync(RoleAssignment)
Asynchronously returns a boolean indicating whether a member has been assigned to a particular role.
Declaration
Task<bool> IsAssignedAsync(RoleAssignment assignment)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleAssignment | assignment | Identifies the role assigment, which is to be verified |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.Boolean> | True if the member has been assigned the role, false otherwise |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Role assignment is insufficient |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Remove(RoleId)
Removes an existing role from the system.
Declaration
void Remove(RoleId roleId)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | ID of the role to remove |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
RemoveAsync(RoleId)
Asynchronously removes an existing role from the system.
Declaration
Task RemoveAsync(RoleId roleId)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | ID of the role to remove |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Unassign(RoleAssignment)
Removes the assignment of a role from a particular group member.
Declaration
void Unassign(RoleAssignment assignment)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleAssignment | assignment | Describes the assignment of a role to a member |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Role assignment data is null |
| System.ArgumentException | Role assignment is insufficient |
| MemberDoesNotExistException | Thrown when the identified member does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
UnassignAsync(RoleAssignment)
Asynchronously removes the assignment of a role from a particular group member.
Declaration
Task UnassignAsync(RoleAssignment assignment)
Parameters
| Type | Name | Description |
|---|---|---|
| RoleAssignment | assignment | Describes the assignment of a role to a member |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Role assignment data is null |
| System.ArgumentException | Role assignment is insufficient |
| MemberDoesNotExistException | Thrown when the identified member does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
Update<TExtension>(RoleId, TExtension)
Asynchronously updates the extension data corresponding to a role
Declaration
Composite<Role, TExtension> Update<TExtension>(RoleId roleId, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | RoleId used to filter collection with |
| TExtension | extension | Extension data to be added |
Returns
| Type | Description |
|---|---|
| Composite<Role, TExtension> | Composite of Role of the group and extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| RoleDoesNotExistException | Thrown when the identified role does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |
UpdateAsync<TExtension>(RoleId, TExtension)
Asynchronously updates the extension data corresponding to a role
Declaration
Task<Composite<Role, TExtension>> UpdateAsync<TExtension>(RoleId roleId, TExtension extension)
where TExtension : class
Parameters
| Type | Name | Description |
|---|---|---|
| RoleId | roleId | RoleId used to filter collection with |
| TExtension | extension | Extension data to be added |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<Composite<Role, TExtension>> | Composite of Role of the group and extension data |
Type Parameters
| Name | Description |
|---|---|
| TExtension |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | Thrown when any of the parameters passed in are null. |
| System.ArgumentException | Thrown when any of the parameters passed in are invalid. |
| RoleDoesNotExistException | Thrown when the identified role does not exist. |
| SocialException | Thrown when an error occurs while processing the request. |
| SocialAuthenticationException | Thrown when an authentication error occurs while processing the request. |
| MaximumDataSizeExceededException | Thrown when a Social object is submitted, which exceeds the size restrictions of the system. |
| SocialCommunicationException | Thrown when errors occur communicating with the cloud services. |