Setting Permissions Upon Element Creation

If you provide a bean class that implements ApplicationElementCreationHandler (Javadoc), its methods are called whenever a workspace, a scenario, or a view/dashboard is created. This interface defines three methods, named onWorkspaceCreation, onScenarioCreation, and onViewDashboardCreation.

These three methods take as argument:

  • the user who created the application element;

  • the application element (workspace, scenario, view/dashboard) just created;

  • an ApplicationElementPropertiesApi and a PermissionRulesApi instance that provide methods to set properties on the application element and to add permission rules. For more details, please refer to Section Defining Permissions.

You could, for example, use one of these methods to set specific properties on a just-created scenario.

Here also, a freshly generated application contains an implementation of this bean, provided as an example, that duplicates the default behavior, that is, do nothing. You are free to modify it at will, or even remove it if you want to keep the default behavior and save some code.