Class Sentry.DataRightCache
Cache holding data rights on different tables. This should only be used internally by the sentries
Inherited Members
Namespace: SuperOffice.CRM.Security
Assembly: SoDataBase.dll
Syntax
[CacheV2(0)]
public class Sentry.DataRightCache : CacheBaseV2
Constructors
DataRightCache()
Cache holding data rights on different tables. This should only be used internally by the sentries
Declaration
public DataRightCache()
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
GetTableRight(int, EOwnershipIndex)
Get the ETableRight for the logged on user.
Declaration
public ETableRight GetTableRight(int tableNumber, EOwnershipIndex relation)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tableNumber | TableNumber to get table right for. |
| EOwnershipIndex | relation | The relation to the owner of the table |
Returns
| Type | Description |
|---|---|
| ETableRight | Rights on the table. |
GetTableRight(int, int, EOwnershipIndex)
Get the ETableRight for a user in a role.
Declaration
public ETableRight GetTableRight(int roleId, int tableNumber, EOwnershipIndex relation)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roleId | RoleId for the role to check rights for. |
| int | tableNumber | TableNumber to get table right for. |
| EOwnershipIndex | relation | The relation to the owner of the table |
Returns
| Type | Description |
|---|---|
| ETableRight | Rights on the table. |
HasAtLeastRead(int, EOwnershipIndex[])
Check if the logged on user har at least read ETableRight for the given relations.
Declaration
public bool HasAtLeastRead(int tableNumber, EOwnershipIndex[] relations)
Parameters
| Type | Name | Description |
|---|---|---|
| int | tableNumber | TableNumber to get table right for. |
| EOwnershipIndex[] | relations | The relations to the owner of the table |
Returns
| Type | Description |
|---|---|
| bool | true if read rights on the table for all given relations. |
HasAtLeastRead(int, int, EOwnershipIndex[])
Check if the given user har at least read ETableRight for the given relations.
Declaration
public bool HasAtLeastRead(int roleId, int tableNumber, EOwnershipIndex[] relations)
Parameters
| Type | Name | Description |
|---|---|---|
| int | roleId | RoleId for the role to check rights for. |
| int | tableNumber | TableNumber to get table right for. |
| EOwnershipIndex[] | relations |
Returns
| Type | Description |
|---|---|
| bool | true if at least read rights on the table for all given relations. |
OnLoad()
Cache holding data rights on different tables. This should only be used internally by the sentries
Declaration
protected override void OnLoad()
Overrides
OnLoadAsync(CancellationToken)
Cache holding data rights on different tables. This should only be used internally by the sentries
Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
protected override Task OnLoadAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |