getNavigationManager().setCurrentWorkspace(newWorkspace);
}}.execute();
// Add default access/admin permissions to the roles the creator user belongs to.
RolesManager rolesManager = SecurityServices.lookup().getRolesManager();
UIPolicy policy = (UIPolicy) SecurityServices.lookup().getSecurityPolicy();
List<Permission> defaultPermissions = policy.createDefaultPermissions(newWorkspace);
for (String roleId : UserStatus.lookup().getUserRoleIds()) {
Role role = rolesManager.getRoleById(roleId);
RolePrincipal prpal = new RolePrincipal(role);
for (Permission perm : defaultPermissions) {
policy.addPermission(prpal, perm);
}
}
policy.save();
title = null;
name = null;
skinId = UIServices.lookup().getSkinsManager().getDefaultElement().getId();
envelopeId = UIServices.lookup().getEnvelopesManager().getDefaultElement().getId();