Bridge.Editors
Allows for managing and retrieving information about the users who have editing permissions for the current appointment.
.canChangeEditor
Returns true or false depending on whether the current user is allowed to change who the active editor is.
if (Bridge.Editors.canChangeEditor) {
// Show UI to change editors
}
.users
Returns a list of all users who could potentially edit the appointment (the appointment creator plus all contact users).
Returns:
Returns an array of user objects.
const potentialEditors = Bridge.Editors.users;
// [
// { id: 1, type: "creator", canEdit: true, ... },
// { id: 2, type: "contact", canEdit: false, ... }
// ]
.editors
Returns a list of the users who currently have the ability to edit the appointment.
Returns:
Returns an array of user objects where canEdit is true.
const currentEditors = Bridge.Editors.editors;
.canEdit
Returns true if the current presentation is not in read-only mode for the active user.
if (Bridge.Editors.canEdit) {
// Enable editing features
}
.updateEditors(editors)
Updates the list of editors for the appointment. Only one user can be an editor at a time.
| Parameter | Type | Description |
|---|---|---|
| editors | Array | Array of objects containing user id and canEdit boolean |
This command will fail and log an error if the update results in zero editors or more than one editor.
Bridge.Editors.updateEditors([
{ id: 1, canEdit: false },
{ id: 2, canEdit: true },
]);
.returnControlToCreator()
Removes editing permissions from all other users and returns control exclusively to the creator of the appointment.
Bridge.Editors.returnControlToCreator();