# Read-Only Object Entitlements

Canonical page: https://www.adaptabletools.com/docs/handbook-permissioning-objects

- Read-Only Object Entitlements lock individual AdapTable Objects
- They take precedence over a Module Entitlement of `Full`

Sometimes setting a [Module](https://www.adaptabletools.com/docs/technical-reference-adaptable-modules/index.md) level restriction of Entitlements is insufficient.

For instance, a user might require a Module to have a `Full` entitlement (i.e. it's editable) but one particular Object should be `ReadOnly` (i.e. cannot be deleted).

For this reason, AdapTable allows `ReadOnly` Entitlements to be set at the object level.

It is done by setting the `IsReadOnly` property of [Adaptable Object](https://www.adaptabletools.com/docs/dev-guide-adaptable-state-initial-state/index.md#adaptable-objects) to _true_.

This will override the `Full` Entitlement in the Adaptable Module for this object only to be `ReadOnly`

- There is no property for the opposite use case
- You cannot change an AdapTable object to be `Full` where the Module's Entitlement is `ReadOnly`

**Example: Entitlements: ReadOnly Objects**

Permissioning individual objects to be ReadOnly

- This example illustrates how to use `ReadOnly` objects using 2 [Format Columns](https://www.adaptabletools.com/docs/handbook-column-formatting/index.md)
- One - which provides a red background to `Language` cells which contain 'TypeScript' - is marked as `ReadOnly`
- The other - which makes `GitHub Stars` > 50000 light blue - is not marked as `ReadOnly` (so has the Entitlement of the Module which is `Full`)

- Open the Format Column section of the Settings Panel to see the 2 [Format Columns](https://www.adaptabletools.com/docs/handbook-column-formatting/index.md)
- Note that you can edit, suspend, delete one but not the other
- Because the Module has an Entitlement of `Full` you are able to create new Format Columns

Demo project (Vanilla); the files without a marker are shown below:

```text
src/
  adaptableOptions.ts
  agGridModules.ts     [template]
  columnDefs.ts        [template]
  gridOptions.ts       [template]
  index.ts             [template]
  onAdaptableReady.ts  [template]
  rowData.ts           [template]
  styles.css           [template]
index.html             [template]
package.json           [template]
tsconfig.json          [template]
```

Files marked `[template]` are the same in every demo; see the [demo template](https://www.adaptabletools.com/llms/demo-template.md#vanilla).

**`src/adaptableOptions.ts`**

```ts
import {AdaptableOptions} from '@adaptabletools/adaptable';
import {WebFramework} from './rowData';

export const adaptableOptions: AdaptableOptions<WebFramework> = {
  primaryKey: 'id',
  adaptableId: 'Readonly Object Entitlements',

  initialState: {
    Dashboard: {
      ModuleButtons: ['FormatColumn'],
    },
    Theme: {CurrentTheme: 'dark'},
    FormatColumn: {
      FormatColumns: [
        {
          Name: 'formatColumn-language',
          // FormatColumn is ReadOnly - it can be rendered but not endered
          IsReadOnly: true,
          Style: {
            ForeColor: 'var(--ab-color-palette-16)',
            BackColor: 'var(--ab-color-palette-17)',
          },
          Scope: {
            ColumnIds: ['language'],
          },
          Rule: '[language] = "TypeScript"',
        },
        {
          Name: 'formatColumn-github_stars',
          Style: {
            ForeColor: 'LightBlue',
          },
          Scope: {
            ColumnIds: ['github_stars'],
          },
          Rule: '[github_stars] > 50000',
        },
      ],
    },
    Layout: {
      CurrentLayout: 'Standard Layout',
      Layouts: [
        {
          TableColumns: [
            'name',
            'language',
            'github_stars',
            'license',
            'has_projects',
            'has_pages',
            'created_at',
            'has_wiki',
            'updated_at',
            'pushed_at',
            'github_watchers',
            'week_issue_change',
          ],
          Name: 'Standard Layout',
          AutoSizeColumns: true,
        },
      ],
    },
  },
};
```

See [Adaptable Object](https://www.adaptabletools.com/docs/dev-guide-adaptable-state-initial-state/index.md#adaptable-objects) for more information on this topic
