Skip to content

EditorPermissions

Interface describing the current user's permissions in the Stripo Email Editor.

typescript
interface EditorPermissions

Description

EditorPermissions represents the set of feature permissions granted to the current editor user. Each permission group is an EditorPermissionAccess object with optional read and write flags. Permissions are provided by your backend through the User Permissions API and can be read in extensions via BaseApi using getUserPermissions() or observed with onUserPermissionsUpdated().

See Permissions and Access Management for how permissions are configured on your backend.

Import

typescript
import type { EditorPermissions } from '@stripoinc/ui-editor-extensions';

Properties

All properties are optional. A missing permission group means no restriction information is available for it.

PropertyTypeDescription
appearanceEditorPermissionAccessAccess to appearance settings (fonts, colors, styles)
codeEditorEditorPermissionAccessAccess to the HTML code editor
contentEditorContentPermissionAccessAccess to template content, with optional text-only editing
modulesEditorPermissionAccessAccess to browsing and managing custom/saved modules
entityImagesEditorPermissionAccessAccess to the image gallery scoped to the current entity
projectImagesEditorPermissionAccessAccess to the image gallery scoped to the project
versionHistoryEditorPermissionAccessAccess to viewing and restoring template version history
manageOwnCommentsEditorPermissionAccessAccess to viewing and managing the user's own comments
manageAllCommentsEditorPermissionAccessAccess to viewing and managing comments of all users
replyAllCommentsEditorPermissionAccessAccess to replying to comments of all users
accessibilityTestingEditorPermissionAccessAccess to the Accessibility Testing Mode
elementsLockEditorPermissionAccessAccess to locking and unlocking template elements

EditorPermissionAccess

Base access descriptor for a permission group.

typescript
interface EditorPermissionAccess {
    read?: boolean;
    write?: boolean;
}
PropertyTypeDescription
readbooleanAllows viewing the feature
writebooleanAllows modifying data through the feature

EditorContentPermissionAccess

Access descriptor for the content permission group with an additional text-only flag.

typescript
interface EditorContentPermissionAccess extends EditorPermissionAccess {
    textOnly?: boolean;
}
PropertyTypeDescription
textOnlybooleanAllows editing only text values without changing layout or design

Example

typescript
const permissions = this.api.getUserPermissions();

// Adapt extension UI to the user's access level
if (!permissions.content?.write) {
    this.disableEditingControls();
}

if (permissions.content?.textOnly) {
    this.enableTextOnlyMode();
}

// React to permission changes
this.api.onUserPermissionsUpdated((newPermissions) => {
    this.setEditingEnabled(!!newPermissions.content?.write);
});