Class TestableRoleController
Inheritance
Implements
Inherited Members
Namespace: DotNetNuke.Security.Roles.Internal
Assembly: DotNetNuke.dll
Syntax
public class TestableRoleController : ServiceLocator<IRoleController, TestableRoleController>, IRoleController
Methods
| Improve this Doc View SourceAddRole(RoleInfo, Boolean)
Adds a role.
Declaration
public int AddRole(RoleInfo role, bool addToExistUsers)
Parameters
Type | Name | Description |
---|---|---|
RoleInfo | role | The Role to Add. |
System.Boolean | addToExistUsers | Add this role on all exist users if auto assignment is true. |
Returns
Type | Description |
---|---|
System.Int32 | The Id of the new role. |
AddRole(RoleInfo)
Adds a role.
Declaration
public int AddRole(RoleInfo role)
Parameters
Type | Name | Description |
---|---|---|
RoleInfo | role | The Role to Add. |
Returns
Type | Description |
---|---|
System.Int32 | The Id of the new role. |
ClearRoleCache(Int32)
Clears Roles cache for the passed portal ID and for the default ID (-1) as well.
Declaration
public void ClearRoleCache(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | Id of the portal. |
DeleteRole(RoleInfo)
Deletes a role.
Declaration
public void DeleteRole(RoleInfo role)
Parameters
Type | Name | Description |
---|---|---|
RoleInfo | role | The Role to delete. |
GetFactory()
Gets the service locator factory.
Declaration
protected override Func<IRoleController> GetFactory()
Returns
Type | Description |
---|---|
Func<IRoleController> | A factory function. |
Overrides
GetRole(Int32, Func<RoleInfo, Boolean>)
Fetch a single role based on a predicate.
Declaration
public RoleInfo GetRole(int portalId, Func<RoleInfo, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | Id of the portal. |
Func<RoleInfo, System.Boolean> | predicate | The predicate (criteria) required. |
Returns
Type | Description |
---|---|
RoleInfo | A RoleInfo object. |
GetRoles(Int32, Func<RoleInfo, Boolean>)
Get the roles based on a predicate.
Declaration
public IList<RoleInfo> GetRoles(int portalId, Func<RoleInfo, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | Id of the portal. |
Func<RoleInfo, System.Boolean> | predicate | The predicate (criteria) required. |
Returns
Type | Description |
---|---|
IList<RoleInfo> | A List of RoleInfo objects. |
GetRoles(Int32)
Obtains a list of roles from the cache (or for the database if the cache has expired).
Declaration
public IList<RoleInfo> GetRoles(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The id of the portal. |
Returns
Type | Description |
---|---|
IList<RoleInfo> | The list of roles. |
GetRolesBasicSearch(Int32, Int32, String)
get a list of roles based on progressive search.
Declaration
public IList<RoleInfo> GetRolesBasicSearch(int portalID, int pageSize, string filterBy)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalID | the id of the portal. |
System.Int32 | pageSize | the number of items to return. |
System.String | filterBy | the text used to trim data. |
Returns
Type | Description |
---|---|
IList<RoleInfo> | An |
GetRoleSettings(Int32)
Gets the settings for a role.
Declaration
public IDictionary<string, string> GetRoleSettings(int roleId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | roleId | Id of the role. |
Returns
Type | Description |
---|---|
IDictionary<System.String, System.String> | A Dictionary of settings. |
UpdateRole(RoleInfo, Boolean)
Persists a role to the Data Store.
Declaration
public void UpdateRole(RoleInfo role, bool addToExistUsers)
Parameters
Type | Name | Description |
---|---|---|
RoleInfo | role | The role to persist. |
System.Boolean | addToExistUsers | Add this role on all exist users if auto assignment is true. |
UpdateRole(RoleInfo)
Persists a role to the Data Store.
Declaration
public void UpdateRole(RoleInfo role)
Parameters
Type | Name | Description |
---|---|---|
RoleInfo | role | The role to persist. |
UpdateRoleSettings(RoleInfo, Boolean)
Update the role settings.
Declaration
public void UpdateRoleSettings(RoleInfo role, bool clearCache)
Parameters
Type | Name | Description |
---|---|---|
RoleInfo | role | The Role. |
System.Boolean | clearCache | A flag that indicates whether the cache should be cleared. |