> ## 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.

# DataRight table

> Data right definition

## DataRight Table (195)

Data right definition

## Fields

| Name                      | Description                                                                                                                                                                                                                                                          | Type                                                | Nullable |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | :------: |
| DataRight\_id             | Primary key                                                                                                                                                                                                                                                          | PK                                                  |    No    |
| roleId                    | Role this dataright is valid for                                                                                                                                                                                                                                     | FK [Role](./role.mdx)                               |    No    |
| tableId                   | ID of table this right is valid for                                                                                                                                                                                                                                  | TableNumber                                         |    No    |
| fieldId                   | ID of field this right is valid for. 0 = whole table. Must correspond to tableId!                                                                                                                                                                                    | FieldId                                             |    No    |
| relationToOwner           | How is the owner related to the target -  0 = Owner, 1 = Primary group, 2 = Other, 3 = Other group, 4 = External, 5 = Anonymous, 6 = My company, 7 = Same project, 8 = Other to external, 9 = Hide this relation (used with ShownOtherCompanyAssoc functional right) | Enum [RelationToOwner](./enums/relationtoowner.mdx) |    No    |
| CRUD                      | Allowed operations, composed of characters indicating operations.                                                                                                                                                                                                    | String(39)                                          |    No    |
| encryptedCheck            | Encrypted data, to detect unwanted changes                                                                                                                                                                                                                           | String(254)                                         |    No    |
| registered                | Registered when                                                                                                                                                                                                                                                      | UtcDateTime                                         |    No    |
| registered\_associate\_id | Registered by whom                                                                                                                                                                                                                                                   | FK [associate](./associate.mdx)                     |    No    |
| updated                   | Last updated when                                                                                                                                                                                                                                                    | UtcDateTime                                         |    No    |
| updated\_associate\_id    | Last updated by whom                                                                                                                                                                                                                                                 | FK [associate](./associate.mdx)                     |    No    |
| updatedCount              | Number of updates made to this record                                                                                                                                                                                                                                | UShort                                              |    No    |

<img src="https://mintcdn.com/superofficeas/-KbDeS3ObOMH8eFq/media/loc/en/database/tables/DataRight.png?fit=max&auto=format&n=-KbDeS3ObOMH8eFq&q=85&s=36d8d952b4f1e81141dce988450ad5f4" alt="DataRight table relationship diagram" width="603" height="59" data-path="media/loc/en/database/tables/DataRight.png" />

## Indexes

| Fields                                    | Types                          | Description |
| ----------------------------------------- | ------------------------------ | ----------- |
| roleId                                    | FK                             | Index       |
| roleId, tableId, fieldId, relationToOwner | FK, TableNumber, FieldId, Enum | Unique      |

## Relationships

| Table                    | Description                                                                                                                                                                                        |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [associate](./associate) | Employees, resources and other users - except for External persons                                                                                                                                 |
| [Role](./role)           | User roles for role-based security, names and tooltips are in LocaleText. For more information regarding role based security, see [http://techdoc.superoffice.com](http://techdoc.superoffice.com) |

## Replication Flags

* Replicate changes DOWN from central to satellites and travellers.
* Replicate changes UP from satellites and travellers back to central.
* Copy to satellite and travel prototypes.

## Security Flags

* No access control via user's Role.


## Related topics

- [SuperOffice.WebApi.Data.DataRight](/en/api/reference/webapi/SuperOffice.WebApi.Data.DataRight.md)
- [SuperOffice.WebApi.Data.DataRights](/en/api/reference/webapi/SuperOffice.WebApi.Data.DataRights.md)
- [SuperOffice.WebApi.Data.RoleEntity](/en/api/reference/webapi/SuperOffice.WebApi.Data.RoleEntity.md)
- [Role table](/en/database/tables/role.md)
- [Create Default Role Entity](/en/api/reference/restful/agent/user_agent/create-default-role-entity.md)
- [Save Role Entity](/en/api/reference/restful/agent/user_agent/save-role-entity.md)
