# FPresentationPermission

- Human documentation: [https://docs.univer.ai/reference/facade/presentation-permission](https://docs.univer.ai/reference/facade/presentation-permission)

- Agent Markdown: [https://docs.univer.ai/reference/facade/presentation-permission.md](https://docs.univer.ai/reference/facade/presentation-permission.md)

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [facade/presentation-permission.mdx](https://github.com/dream-num/documentation/blob/dev/content/reference/facade/presentation-permission.mdx)

---

Command-backed permissions for one Presentation unit.

## Access

Access through:

* [`FPresentation.getPermission()`](https://docs.univer.ai/reference/facade/presentation.md#getpermission)

## Setup

Register [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) or a preset that includes it. In plugin mode, import `@univerjs-pro/slides/facade`. Additional methods below require their listed plugin packages. See [Facade setup](https://docs.univer.ai/guides/slides/getting-started/facade.md).

## `@univerjs-pro/slides`

### `FPresentationPermission.canEdit`

Returns whether the whole Presentation is currently editable.

```typescript
canEdit(): boolean
```

**Returns**

Whether Presentation editing is allowed.

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide-permission.d.ts)

### `FPresentationPermission.getPoint`

Returns the current value of one Presentation unit permission.

```typescript
getPoint(action: SlideUnitPermissionAction): boolean
```

**Parameters**

* `action` — Required. Unit permission action to query.

**Returns**

Whether the action is currently allowed.

**Examples**

```ts
import { UnitAction } from '@univerjs/protocol'

const presentation = univerAPI.getActivePresentation()
console.log(presentation?.getPermission().getPoint(UnitAction.Print))
```

**Types:** [`SlideUnitPermissionAction`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/services/slide-permission.service.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide-permission.d.ts)

### `FPresentationPermission.setEditable`

Enables or disables editing for the whole Presentation.

```typescript
setEditable(editable?: boolean): Promise<void>
```

**Parameters**

* `editable` — Optional. Default: `true`. Whether editing is allowed. Defaults to true.

**Returns**

Resolves after the permission command finishes.

**Types:** [`Promise`](https://unpkg.com/@typescript/typescript-darwin-arm64@7.0.2/lib/lib.es5.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide-permission.d.ts)

### `FPresentationPermission.setObjectPermissions`

Creates or updates child-object edit policies in this unit; policy: null removes protection and restores inheritance.

Requires Authz support and objectPermissionTypes configured for every target type. File and parent restrictions
still apply. Use the exported permission object ID helpers, not raw object IDs or server permission IDs.
The batch must be nonempty, contain distinct objects, and belong to this unit; file-wide policies are excluded.
Other targets use getSlideElementPermissionObjectId and SLIDE\_MASTER\_VIEW\_PERMISSION\_OBJECT\_ID.

edit: 'all' allows Unit editors, 'owner' restricts editing to the object owner, and 'members' selects existing
Unit collaborators. Pass their collaborator records from the member service; this does not invite new users.
Use strategies: \[] for the default Edit strategy; child-object strategies support only UnitAction.Edit.

Authz writes execute per object and can partially succeed. Inspect failed before retrying only those objects.
refreshError means writes finished but permission readback failed; do not retry succeeded objects for that error.
Successful binding changes share one undo entry; existing remote policy edits are not undoable.

```typescript
setObjectPermissions(changes: IObjectPermissionChange[]): Promise<IObjectPermissionBatchResult>
```

**Parameters**

* `changes` — Required. Permission object IDs and policies to apply.

**Returns**

Successful object IDs, per-object failures, and optional readback error.

**Throws**

Invalid batches or unsupported object types are rejected before Authz writes.

**Examples**

Set owner/member editing and remove protection in one batch

```ts
import type { ICollaborator } from '@univerjs/protocol'
import { getSlidePagePermissionObjectId } from '@univerjs-pro/slides'

// selectedMembers comes from the existing Unit collaborator picker/service.
async function applyPermissions(selectedMembers: ICollaborator[]) {
  if (!selectedMembers.length) throw new Error('Select at least one Unit collaborator.')
  const presentation = univerAPI.getActivePresentation()
  if (!presentation) throw new Error('No active presentation.')
  const objectIds = presentation
    .getSlides()
    .slice(0, 3)
    .map((slide) => getSlidePagePermissionObjectId(slide.getId()))
  if (objectIds.length < 3) throw new Error('This example requires three slides.')
  const result = await presentation.getPermission().setObjectPermissions([
    { objectId: objectIds[0], policy: { edit: 'owner', collaborators: [], strategies: [] } },
    {
      objectId: objectIds[1],
      policy: { edit: 'members', collaborators: selectedMembers, strategies: [] },
    },
    { objectId: objectIds[2], policy: null },
  ])
  // A policy creates protection if absent, or updates the existing policy when already configured.
  for (const failure of result.failed) {
    console.error(failure.objectId, failure.error)
  }
  if (result.refreshError) {
    console.error(result.refreshError)
  }
  return result
}
```

**Types:** [`IObjectPermissionBatchResult`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/services/permission/object-permission.service.d.ts) · [`Promise`](https://unpkg.com/@typescript/typescript-darwin-arm64@7.0.2/lib/lib.es5.d.ts) · [`IObjectPermissionChange`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/services/permission/object-permission.service.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide-permission.d.ts)

### `FPresentationPermission.setPoint`

Sets one Presentation unit permission through the command system.

Supported actions are Edit, Copy, Print, Export, and Comment.

```typescript
setPoint(action: SlideUnitPermissionAction, value: boolean): Promise<void>
```

**Parameters**

* `action` — Required. Unit permission action to update.
* `value` — Required. Whether the action is allowed.

**Returns**

Resolves after the permission command finishes.

**Examples**

```ts
import { UnitAction } from '@univerjs/protocol'

const presentation = univerAPI.getActivePresentation()
if (!presentation) throw new Error('No active Presentation.')
await presentation.getPermission().setPoint(UnitAction.Export, false)
```

**Types:** [`Promise`](https://unpkg.com/@typescript/typescript-darwin-arm64@7.0.2/lib/lib.es5.d.ts) · [`SlideUnitPermissionAction`](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/services/slide-permission.service.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide-permission.d.ts)

### `FPresentationPermission.setReadOnly`

Makes the whole Presentation read-only.

```typescript
setReadOnly(): Promise<void>
```

**Returns**

Resolves after the permission command finishes.

**Examples**

```ts
const presentation = univerAPI.getActivePresentation()
if (!presentation) throw new Error('No active Presentation.')
await presentation.getPermission().setReadOnly()
```

**Types:** [`Promise`](https://unpkg.com/@typescript/typescript-darwin-arm64@7.0.2/lib/lib.es5.d.ts)

**Package:** [`@univerjs-pro/slides`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/slides.md) · [Type definitions](https://unpkg.com/@univerjs-pro/slides@1.0.0-rc.0/lib/types/facade/f-slide-permission.d.ts)
