public PermissionSet getPermissionSet(String[] permissions) { try {  PermissionSet permissionSet = new PermissionSet(); for (int i = 0; i < permissions.length; i++) { try { permissionSet.add(this.permissionManager.getPermissionByName(permissions[i])); } catch (UnknownEntityException e1) {  try { Permission permission = this.permissionManager.getPermissionInstance(permissions[i]); this.permissionManager.addPermission(permission); permissionSet.add(permission); } catch (UnknownEntityException e) { this.log.error("Cannot find permission", e); throw new NestableRuntimeException(e); } catch (EntityExistsException e) { this.log.error("Somehow the entity exists and does not exist", e); throw new NestableRuntimeException(e); } } }  return permissionSet;  } catch (DataBackendException e) { this.log.error("Trying to initialize start permissions not possible", e); throw new NestableRuntimeException(e);
public PermissionSet getPermissionSet(String permissionsString) { if (permissionsString != null) { String[] permissions = permissionsString.split(";"); return getPermissionSet(permissions); } else { return new PermissionSet();
    public PermissionSet getPermissionSet(String[] permissions) {        try {            PermissionSet permissionSet = new PermissionSet();            for (int i = 0; i < permissions.length; i++) {                try {                    permissionSet.add(this.permissionManager.getPermissionByName(permissions[i]));                } catch (UnknownEntityException e1) {                    // Does not exist yet so create it                    try {                        Permission permission = this.permissionManager.getPermissionInstance(permissions[i]);                        this.permissionManager.addPermission(permission);                        permissionSet.add(permission);                    } catch (UnknownEntityException e) {                        this.log.error("Cannot find permission", e);                        throw new NestableRuntimeException(e);                    } catch (EntityExistsException e) {                        this.log.error("Somehow the entity exists and does not exist", e);                        throw new NestableRuntimeException(e);                    }                }            }            return permissionSet;        } catch (DataBackendException e) {            this.log.error("Trying to initialize start permissions not possible", e);            throw new NestableRuntimeException(e);        }    }