Class SentryAgent
Facade for the Sentry Agent Data and function right queries
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
public class SentryAgent : AgentBase<ISentryAgent>, IDisposable, 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...
}
}
Constructors
SentryAgent()
Facade for the Sentry Agent Data and function right queries
Declaration
public SentryAgent()
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
CanCreateAppointmentInAllDiaries()
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
public bool CanCreateAppointmentInAllDiaries()
Returns
Type | Description |
---|---|
Boolean | Returns true if the current associate can create appointments in the diary of all the other associates, otherwise false. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SentryAgent agent = new SentryAgent())
{
// call methods on agent here...
}
}
CanCreateAppointmentInAssociateDiaries(Int32[])
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
public bool CanCreateAppointmentInAssociateDiaries(int[] associateIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | associateIds | Array of associate ids to check. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the current associate can create appointments in the diary of all the other associates, otherwise false. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SentryAgent agent = new SentryAgent())
{
// call methods on agent here...
}
}
CanCreateAppointmentInEachAssociatesDiary(Int32[])
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
public bool[] CanCreateAppointmentInEachAssociatesDiary(int[] associateIds)
Parameters
Type | Name | Description |
---|---|---|
Int32[] | associateIds | Array of associate ids to check. |
Returns
Type | Description |
---|---|
Boolean[] | Returns true if for each given associate if the current associate can create appointments in that diary, otherwise false. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SentryAgent agent = new SentryAgent())
{
// call methods on agent here...
}
}
GetFunctionRights()
Get a string array of all functions rights for the role of the current associate.
Declaration
public string[] GetFunctionRights()
Returns
Type | Description |
---|---|
String[] | String array with the technical names of assigned function rights |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SentryAgent agent = new SentryAgent())
{
// call methods on agent here...
}
}
GetNewTableRight(String)
Returns a TableRight for a new row based on tableName parameter.
Declaration
public TableRight GetNewTableRight(string tableName)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Name of the table to get the TableRights from |
Returns
Type | Description |
---|---|
TableRight | The TableRight |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SentryAgent agent = new SentryAgent())
{
// call methods on agent here...
}
}
GetTableRightByContactOwnership(String, Int32)
Return the TableRight from the relationship between the current user and the given user and group.
Declaration
public TableRight GetTableRightByContactOwnership(string tableName, int contactId)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Name of the table to get the TableRights from. |
Int32 | contactId | The owner contact. |
Returns
Type | Description |
---|---|
TableRight | The TableRight |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SentryAgent agent = new SentryAgent())
{
// call methods on agent here...
}
}
GetTableRightByOwnership(String, Int32, Int32)
Return the TableRight from the relationship between the current user and the given user and group.
Declaration
public TableRight GetTableRightByOwnership(string tableName, int contactGroupId, int contactAssociateId)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Name of the table to get the TableRights from. |
Int32 | contactGroupId | The user-group that the associate id is part of. |
Int32 | contactAssociateId | The associate id of the owner of the record |
Returns
Type | Description |
---|---|
TableRight | The TableRight |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SentryAgent agent = new SentryAgent())
{
// call methods on agent here...
}
}
HasFunctionRight(String)
Get a boolean value indicating if the current user has the functional right.
Declaration
public bool HasFunctionRight(string functionRight)
Parameters
Type | Name | Description |
---|---|---|
String | functionRight | Function right to check. |
Returns
Type | Description |
---|---|
Boolean |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (SentryAgent agent = new SentryAgent())
{
// call methods on agent here...
}
}