Class FunctionRightCache
Inherited Members
Namespace: SuperOffice.CRM.Security
Assembly: SoDataBase.dll
Syntax
[CacheV2(0)]
public class FunctionRightCache : CacheBaseV2
Constructors
FunctionRightCache()
Declaration
public FunctionRightCache()
Properties
TableNames
Gets the names of the table data that are cached in this cache. When these tables are updated the cache will be disposed so a new cache instance can take its place.
Declaration
protected override IEnumerable<string> TableNames { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
Overrides
Methods
GetFunctionRightNameById(int)
Get the functional right identified by the primary key.
Declaration
public string GetFunctionRightNameById(int functionRightId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | functionRightId |
Returns
| Type | Description |
|---|---|
| string | The function right name if found; null if it does not exist. |
GetFunctionRights()
Get the functional rights for the currently logged on user.
Declaration
public string[] GetFunctionRights()
Returns
| Type | Description |
|---|---|
| string[] | Array with the list of the names for all the rights. |
GetFunctionRights(int)
Get the functional rights for the role.
Declaration
public string[] GetFunctionRights(int roleId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roleId | Id of the role. |
Returns
| Type | Description |
|---|---|
| string[] | Array with the list of the names for all the rights. |
GetRoleType(int)
Return the role type based on the role id. Role Type maps to UserType.
Declaration
public RoleType GetRoleType(int roleId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roleId | primary key |
Returns
| Type | Description |
|---|---|
| RoleType | Assoc/ System / Anon / Extern |
HasFunctionRight(string)
Check if the logged on user has the given right.
Declaration
public bool HasFunctionRight(string functionRight)
Parameters
| Type | Name | Description |
|---|---|---|
| string | functionRight | Name of the right like 'admin-all'. |
Returns
| Type | Description |
|---|---|
| bool | True if the logged on user has the functional right. |
HasFunctionRight(string, int)
Does the given role have the given right
Declaration
public bool HasFunctionRight(string functionRight, int roleId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | functionRight | Name of the right like 'amin-all'. |
| int | roleId | Id of the role. |
Returns
| Type | Description |
|---|---|
| bool | True if the role has the functional right. |
OnLoad()
Actual cache loading method, to be implemented by derived class. Sentry is Ignored when this method is called
Declaration
protected override void OnLoad()
Overrides
OnLoadAsync(CancellationToken)
Actual cache loading method, to be implemented by derived class. Sentry is Ignored when this method is called
Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
protected override Task OnLoadAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
Overrides
ShouldReporterBeHidden()
We may want to hide the existence of Reporter, for various reasons
Declaration
public static bool ShouldReporterBeHidden()
Returns
| Type | Description |
|---|---|
| bool |