Advanced Permissions

  1. Overview
  2. Use cases
  3. How it works
  4. Available permissions and behaviors
  5. Role templates

Overview

With Advanced permissions, you can tailor permissions for users of the plugin by hiding or locking UI elements related to:

  • content tiles
  • content settings
  • layout settings
  • row & content actions (clone, delete, drag, save)
  • basically anything in the editor!

These advanced permissions grant total customization of the experience you want to present. Since you set them in the configuration parameters passed to BEE Plugin after you’ve initialized it, they could be different each time the editor starts, and have different setups for different users.

Use cases

The absolute flexibility of these permissions makes it easy to address specific needs, not achievable with the Roles and Permissions feature that is available in the Developer portal.

Create skill-based roles

You can create roles that can act only on a content type. For example, you may want a “copywriter” role for people in an organization that only need to touch copy for editing or translation purposes. To do so, you can:

  • hide any action that doesn’t involve working on the copy of an email or page. 
  • limit style options for the text itself, by 
    • locking/hiding the side tab;
    • hiding specific settings in the text toolbar.

Here is a brief example of how a “copywriter” role built with Advanced permission could look like:

 

 

Customize image & file management workflows

You can limit how users upload and manage images and files inside the plugin; for example, you want some users – say, external collaborators – to select pre-approved images and files uploaded by “admin” users. You can do so by:

  • disabling drag-and-drop of images onto the stage;
  • limit actions in the file picker (either the plugin’s or your custom file picker) by disabling actions like upload, import, and create a folder.

Another interesting case for using advanced permissions is the possibility to set a maximum size for uploads, per user. When this permission is configured, the plugin will check if a file exceeds the set size before uploading it; if so, the plugin will return an error message, which you may customize using Custom languages.

Create custom, secondary roles

When customers of your applications are structured businesses, typically with a headquarter and a locally-deployed organization (e.g., Real Estate, Travel, Retail), their administrators can create custom, secondary roles to match any internal policy they might have. In this scenario, admins typically want to reduce disruptions of centrally-deployed templates for external communication, while allowing a specific degree of freedom.

Initialize different versions of the editor

By combining multiple permissions, you can load the plugin with radically different experiences, based on the user that starts it. For example:

  • a “stripped-down” version of BEE for lower-level subscribers;
  • a “simplified” version of BEE for new users of an account.

How it works

To set up the advanced permissions, you will need to add the advancedPermissions object to beeConfig:




beeConfig: {
  uid: 'CmsUserName', // [mandatory]
  container: 'bee-plugin-container', // [mandatory]
  ...
  advancedPermissions: {
    content: {
      button: { ... },
      image: { ... },
      text: { ... },
      divider: { ... },
      social: { ... },
      dynamic: { ... },
      video: { ... },
    },
    settings: {
      contentAreaWidth: { ... },
      containerBackgroundColor: { ... },
      contentBackgroundColor: { ... },
      defaultFontFamily: { ... },
      linkColor: { ... },
    },
    tabs: {
      rows: { ... },
      settings: { ... },
      content: { ... }
    },
    rows: {
      behaviors: { ... },
      backgroundColorRow: { ... },
      backgroundColorContent: { ... },
      doNotStackOnMobile: { ... },
      backgroundImage: { ... },
      displayConditions: { ... },
      columnTabs: { ... },
    }
  }
}


Available permissions and behaviors

You can add all the permissions, some of them, or just one. It is up to your application to create them for all users or a segment, as there are no related server-side settings. You may have a different setup each time the editor starts.

All the permissions use a similar pattern, but the object must match the content schema for the type of content (described in the following section).

Defaults

Each content type below contains a parameter for “behaviors” and “properties”. The behaviors control what someone can, or can’t, do. The properties parameter is an array of sidebar property widgets (e.g., the width slider), and each widget has its default permissions.

Sidebar property widget permissions

All sidebar property widgets (e.g. width slider, alignment, color, etc.) accept the following basic permissions:

Name Type Value
locked boolean true or false
show boolean true or false

Let’s look at an example of these permissions applied to an image module. The following example will hide the image width property widget and lock the text alignment widget.  We’ll cover more of the available settings below.




beeConfig: {
  uid: 'CmsUserName', // [mandatory]
  container: 'bee-plugin-container', // [mandatory]
  ...
  advancedPermissions: {
    content: {
      image: {
        properties: {
          imageWidth: {
            show: false,
          },
          textAlign: {
            show: true,
            locked: true
          },
        }
      },
    },
  }
}  



Default behaviors

All contents and rows (e.g. image module, video module, stage row, etc.) accept the following basic behaviors:

Name Type Value Description
canSelect boolean true or false Can select a row or module to edit it’s properties
canAdd boolean true or false Can drag and drop the content tile or row onto the stage
canViewSidebar boolean true or false Can view the content in the sidebar
canClone boolean true or false Can clone a content or row on the stage
canMove boolean true or false Can drag content to another location on the stage
canDelete boolean true or false Can remove the content or row from the stage

Let’s look at an example of these behaviors applied to an image module. The following example will hide the image content tile on the sidebar.  We’ll cover more of the available settings below.




beeConfig: {
  uid: 'CmsUserName', // [mandatory]
  container: 'bee-plugin-container', // [mandatory]
  ...
  advancedPermissions: {
    content: {
      image: {
        behaviors: {
          canViewSidebar: false,
        }
      },
    },
  }
}  



components

filePicker




filePicker: {
  canUpload: true,
  maxUploadFileSize: 20 * 1024 * 1024,
  canChangeImage: true"
  canApplyEffects: false, 
  canCreateFolder: false, 
  canDeleteFolder: false, 
  canDeleteFile: false, 
  canImportFile: false, 
  canSearchFreePhotos: false,
}


rows




rows: {
  behaviors: {
    canSelect: true,
    canAdd: false,
    canViewSidebar: true,
    canClone: true,
    canMove: true,
    canDelete: true,
  },
  backgroundColorRow: {
      show: true,
      locked: false
  },
  backgroundColorContent: {
      show: true,
      locked: false
  },
  doNotStackOnMobile: {
      show: true,
      locked: false
  },
  backgroundImage: {
      show: true,
      locked: false
  },
  displayConditions: {
      show: true,
      locked: false
  },
  columnTabs: {
      show: true,
      locked: false
  },
},


tabs




tabs: {
    rows: {
      show: true,
      locked: false
    },
    settings: {
      show: true,
      locked: false
    },
    content: {
      show: true,
      locked: false
    },
  },


settings




settings: {
    contentAreaWidth: {
      show: true,
      locked: false
    },
    containerBackgroundColor: {
      show: true,
      locked: false
    },
    contentBackgroundColor: {
      show: true,
      locked: false
    },
    defaultFontFamily: {
      show: true,
      locked: false
    },
    linkColor: {
      show: true,
      locked: false
    },
},


content

button




button: {
  textEditor: {
    ... coming soon
  },
  behaviors: {
    canSelect: true,
    canAdd: false,
    canViewSidebar: true,
    canClone: true,
    canMove: true,
    canDelete: true,
  },
  properties: {
    link: {
      show: true,
      locked: false
    },
    buttonWidth: {
      show: true,
      locked: false
    },
    padding: {
      show: true,
      locked: false
    },
    backgroundColor: {
      show: true,
      locked: false
    },
    textColor: {
      show: true,
      locked: false
    },
    textAlign: {
      show: true,
      locked: false
    },
    buttonLineHeight: {
      show: true,
      locked: false
    },
    borderRadius: {
      show: true,
      locked: false
    },
    contentPadding: {
      show: true,
      locked: false
    },
    border: {
      show: true,
      locked: false
    },
    hideOnMobile: {
      show: true,
      locked: false
    },
  },
}


image




image: {
  behaviors: {
    canSelect: true,
    canAdd: false,
    canViewSidebar: true,
    canClone: true,
    canMove: true,
    canDelete: true,
  },
  properties: {
    imageWidth: {
      show: true,
      locked: false
    },
    textAlign: {
      show: true,
      locked: false
    },
    dynamicImage: {
      show: true,
      locked: false
    },
    imageSelector: {
      show: true,
      locked: false
    },
    inputText: {
      show: true,
      locked: false
    },
    link: {
      show: true,
      locked: false
    },
    padding: {
      show: true,
      locked: false
    },
  }
}


divider




divider: {
  behaviors: {
    canSelect: true,
    canAdd: false,
    canViewSidebar: true,
    canClone: true,
    canMove: true,
    canDelete: true,
  },
  properties: {
    textColor: {
      show: true,
      locked: false
    },
    linkColor: {
      show: true,
      locked: false
    },
    lineHeight: {
      show: true,
      locked: false
    },
    padding: {
      show: true,
      locked: false
    },
    hideOnMobile: {
      show: true,
      locked: false
    },
  },
}


text




text: {
  textEditor: {
    ... coming soon
  },
  behaviors: {
    canSelect: true,
    canAdd: false,
    canViewSidebar: true,
    canClone: true,
    canMove: true,
    canDelete: true,
  },
  properties: {
    textColor: {
      show: true,
      locked: false
    },
    linkColor: {
      show: true,
      locked: false
    },
    lineHeight: {
      show: true,
      locked: false
    },
    padding: {
      show: true,
      locked: false
    },
    hideOnMobile: {
      show: true,
      locked: false
    },
  },
}


social




social: {
  behaviors: {
    canSelect: true,
    canAdd: false,
    canViewSidebar: true,
    canClone: true,
    canMove: true,
    canDelete: true,
  },
  properties: {
    iconsMode: {
      show: true,
      locked: false
    },
    icons: {
      show: true,
      locked: false
    },
    align: {
      show: true,
      locked: false
    },
    iconSpacing: {
      show: true,
      locked: false
    },
    padding: {
      show: true,
      locked: false
    },
    hideOnMobile: {
      show: true,
      locked: false
    },
  },
}


dynamic




dynamic: {
  behaviors: {
    canSelect: true,
    canAdd: false,
    canViewSidebar: true,
    canClone: true,
    canMove: true,
    canDelete: true,
  },
  properties: {
    mergeContent: {
      show: true,
      locked: false
    },
    hideOnMobile: {
      show: true,
      locked: false
    },
  },
}


video (email builder block)




video: {
  behaviors: {
    canSelect: true,
    canAdd: false,
    canViewSidebar: true,
    canClone: true,
    canMove: true,
    canDelete: true,
  },
  properties: {
    videoUrl: {
      show: true,
      locked: false
    },
    videoIcon: {
      show: true,
      locked: false
    },
    padding: {
      show: true,
      locked: false
    },
    hideOnMobile: {
      show: true,
      locked: false
    },
    padding: {
      show: true,
      locked: false
    },
  },
}


html




html: {
  behaviors: {
    canSelect: true,
    canAdd: false,
    canViewSidebar: true,
    canClone: true,
    canMove: true,
    canDelete: true,
  },
  properties: {
    htmlEditor: {
      show: true,
      locked: false
    },
    hideOnMobile: {
      show: true,
      locked: false
    },
  },
}


Role templates

We’ve put together a few JSON templates of custom roles created with Advanced permissions, so you can get started experimenting with this powerful feature.

You can find them in our GitHub account.