Class

Permissions (collaboration-core)

@ckeditor/ckeditor5-collaboration-core/src/permissions

class

The Permissions plugin manages permissions set for the local user.

Following is the list of all defined permissions:

  • document:write - modify the content of the document,
  • comment:write - create, edit and remove own comments,
  • comment:admin - remove comment threads created by other users (enables comment:write).

For example, a user with comment:write permission but with no document:write permission will be able to add comments but will not be able to change the document data (comments-only mode).

By default, all the permissions are set to enabled.

Permissions are handled separately for each channel id (for each editor instance and context instance).

See also the User permissions guide to learn how to use this plugin.

Filtering

Methods

  • setPermissions( permissions, [ channelId ] )

    Sets permissions for editor/context instance with given channelId.

    If channelId is not set, the channel id of the editor/context to which the plugin was added will be used. This means that it is not required if the plugin is added to the editor configuration and Context is not used.

    Parameters

    permissions : Array.<String>

    Permissions to set.

    [ channelId ] : String

    The channel ID.