Show / Hide Table of Contents

Interface ISentryAgent

Interface for the Sentry Agent Data and function right queries

Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("Sentry Agent", "Interface for the Sentry Agent. Data and function right queries")]
public interface ISentryAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;

using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
   using (SentryAgent agent = new SentryAgent())
   {
      // call methods on agent here...
   }
}

Methods

CanCreateAppointmentInAllDiariesAsync(CancellationToken)

CanCreateAppointmentInAllDiaries will check if the current associate can create appointments in diaries belonging all other associates. CanCreateAppointmentInAssociateDiaries will only check against associates that are diary owners.

Declaration
Task<bool> CanCreateAppointmentInAllDiariesAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Returns true if the current associate can create appointments in the diary of all the other associates, otherwise false.

CanCreateAppointmentInAssociateDiariesAsync(int[], CancellationToken)

CanCreateAppointmentInAssociateDiaries will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInAssociateDiaries will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.

Declaration
Task<bool> CanCreateAppointmentInAssociateDiariesAsync(int[] associateIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int[] associateIds

Array of associate ids to check.

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Returns true if the current associate can create appointments in the diary of all the other associates, otherwise false.

CanCreateAppointmentInEachAssociatesDiaryAsync(int[], CancellationToken)

CanCreateAppointmentInEachAssociateDiary will check if the current associate can create appointments in diaries belonging to the associates listed in associateIds. CanCreateAppointmentInEachAssociateDiary will only check against associates that are diary owners. If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.

Declaration
Task<bool[]> CanCreateAppointmentInEachAssociatesDiaryAsync(int[] associateIds, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int[] associateIds

Array of associate ids to check.

CancellationToken cancellationToken
Returns
Type Description
Task<bool[]>

Returns true if for each given associate if the current associate can create appointments in that diary, otherwise false.

GetFunctionRightsAsync(CancellationToken)

Get a string array of all functions rights for the role of the current associate.

Declaration
Task<string[]> GetFunctionRightsAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<string[]>

String array with the technical names of assigned function rights

GetNewTableRightAsync(string, CancellationToken)

Returns a TableRight for a new row based on tableName parameter.

Declaration
Task<TableRight> GetNewTableRightAsync(string tableName, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName

Name of the table to get the TableRights from

CancellationToken cancellationToken
Returns
Type Description
Task<TableRight>

The TableRight

GetTableRightByContactOwnershipAsync(string, int, CancellationToken)

Return the TableRight from the relationship between the current user and the given user and group.

Declaration
Task<TableRight> GetTableRightByContactOwnershipAsync(string tableName, int contactId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName

Name of the table to get the TableRights from.

int contactId

The owner contact.

CancellationToken cancellationToken
Returns
Type Description
Task<TableRight>

The TableRight

GetTableRightByOwnershipAsync(string, int, int, CancellationToken)

Return the TableRight from the relationship between the current user and the given user and group.

Declaration
Task<TableRight> GetTableRightByOwnershipAsync(string tableName, int contactGroupId, int contactAssociateId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tableName

Name of the table to get the TableRights from.

int contactGroupId

The user-group that the associate id is part of.

int contactAssociateId

The associate id of the owner of the record

CancellationToken cancellationToken
Returns
Type Description
Task<TableRight>

The TableRight

HasFunctionRightAsync(string, CancellationToken)

Get a boolean value indicating if the current user has the functional right.

Declaration
Task<bool> HasFunctionRightAsync(string functionRight, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string functionRight

Function right to check.

CancellationToken cancellationToken
Returns
Type Description
Task<bool>
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top