* Below is a list of permissions granted by default.
*/
public synchronized void grantDefaultPermissions() {
log.debug("Grant default permissions.");
RolesManager rolesManager = SecurityServices.lookup().getRolesManager();
WorkspacesManager workspacesManager = UIServices.lookup().getWorkspacesManager();
SectionPermission sectionPerm = new SectionPermission("*", SectionPermission.ACTION_VIEW);
sectionPerm.setReadOnly(true);
PanelPermission panelPerm = new PanelPermission("*", PanelPermission.ACTION_VIEW);
panelPerm.setReadOnly(true);
// All roles can view all sections and panels
for (Role role : rolesManager.getAllRoles()) {
RolePrincipal rolePrincipal = new RolePrincipal(role);
defaultPermissions.add(new Object[] {rolePrincipal, sectionPerm});
defaultPermissions.add(new Object[] {rolePrincipal, panelPerm});
// Give users with pure role "admin" some global permissions