> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NSSentryAgent

> Data and function right queries.

Data and function right queries.

## Constructors

### NSSentryAgent()

```crmscript theme={null}
NSSentryAgent
```

Data and function right queries.

## Methods

## CanCreateAppointmentInAllDiaries()

Checks if the current associate can create appointments in diaries belonging all other associates. It checks only against associates that are diary owners.

```crmscript theme={null}
Bool CanCreateAppointmentInAllDiaries()
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool)

**Example:**

```crmscript theme={null}
NSSentryAgent agent;
Bool res = agent.CanCreateAppointmentInAllDiaries();
```

## CanCreateAppointmentInAssociateDiaries(Integer\[])

Checks if the current associate can create appointments in diaries belonging to the associates listed in associateIds. Checks only against associates that are diary owners.

```crmscript theme={null}
Bool CanCreateAppointmentInAssociateDiaries(Integer[] associateIds)
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool) - If none of the associates listed in the associateIds parameter is a diary owner, the method will return true.

**Example:**

```crmscript theme={null}
NSSentryAgent agent;
Integer[] associateIds;
Bool res = agent.CanCreateAppointmentInAssociateDiaries(associateIds);
```

## CanCreateAppointmentInEachAssociatesDiary(Integer\[])

Checks if the current associate can create appointments in diaries belonging to the associates listed in associateIds. Checks only against associates who are diary owners.

```crmscript theme={null}
Bool[] CanCreateAppointmentInEachAssociatesDiary(Integer[] associateIds)
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool)\[]

## GetFunctionRights()

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

```crmscript theme={null}
String[] GetFunctionRights()
```

**Returns:** [CRMScript.Global.String](CRMScript.Global.String)\[]

**Example:**

```crmscript theme={null}
NSSentryAgent agent;
String[] res = agent.GetFunctionRights();
```

## GetNewTableRight(String)

Returns an NSTableRight for a new row based on tableName parameter.

```crmscript theme={null}
NSTableRight GetNewTableRight(String tableName)
```

**Returns:** [CRMScript.NetServer.NSTableRight](CRMScript.NetServer.NSTableRight)

**Example:**

```crmscript theme={null}
NSSentryAgent agent;
String tableName;
NSTableRight res = agent.GetNewTableRight(tableName);
```

## GetTableRightByContactOwnership(String,Integer)

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

```crmscript theme={null}
NSTableRight GetTableRightByContactOwnership(String tableName, Integer contactId)
```

**Returns:** [CRMScript.NetServer.NSTableRight](CRMScript.NetServer.NSTableRight)

**Example:**

```crmscript theme={null}
NSSentryAgent agent;
String tableName;
Integer contactId;
NSTableRight res = agent.GetTableRightByContactOwnership(tableName, contactId);
```

## GetTableRightByOwnership(String,Integer,Integer)

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

```crmscript theme={null}
NSTableRight GetTableRightByOwnership(String tableName, Integer contactGroupId, Integer contactAssociateId)
```

**Returns:** [CRMScript.NetServer.NSTableRight](CRMScript.NetServer.NSTableRight)

**Example:**

```crmscript theme={null}
NSSentryAgent agent;
String tableName;
Integer contactGroupId;
Integer contactAssociateId;
NSTableRight res = agent.GetTableRightByOwnership(tableName, contactGroupId, contactAssociateId);
```

## HasFunctionRight(String)

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

```crmscript theme={null}
Bool HasFunctionRight(String functionRight)
```

**Returns:** [CRMScript.Global.Bool](CRMScript.Global.Bool)


## Related topics

- [SuperOffice.WebApi.Agents.SentryAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.SentryAgent.md)
- [SuperOffice.WebApi.Agents.ISentryAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ISentryAgent.md)
- [SuperOffice.WebApi.Data.Sentry](/en/api/reference/webapi/SuperOffice.WebApi.Data.Sentry.md)
- [Get Function Rights](/en/api/reference/restful/agent/sentry_agent/get-function-rights.md)
- [Has Function Right](/en/api/reference/restful/agent/sentry_agent/has-function-right.md)
- [Can Create Appointment In All Diaries](/en/api/reference/restful/agent/sentry_agent/can-create-appointment-in-all-diaries.md)
