use of io.lumeer.api.model.Organization in project engine by Lumeer.
the class OrganizationFacade method updateGroupPermissions.
public Set<Permission> updateGroupPermissions(final String organizationCode, final Permission... groupPermissions) {
Organization organization = checkRoleAndGetOrganization(organizationCode, Role.MANAGE);
organization.getPermissions().updateGroupPermissions(groupPermissions);
organizationDao.updateOrganization(organization.getId(), organization);
return organization.getPermissions().getGroupPermissions();
}
use of io.lumeer.api.model.Organization in project engine by Lumeer.
the class OrganizationFacade method createOrganization.
public Organization createOrganization(final Organization organization) {
// TODO check system role for creating organizations
Permission defaultUserPermission = new SimplePermission(authenticatedUser.getUserEmail(), Organization.ROLES);
organization.getPermissions().updateUserPermissions(defaultUserPermission);
Organization storedOrganization = organizationDao.createOrganization(organization);
createOrganizationScopedRepositories(storedOrganization);
return storedOrganization;
}
use of io.lumeer.api.model.Organization in project engine by Lumeer.
the class OrganizationFacade method updateUserPermissions.
public Set<Permission> updateUserPermissions(final String organizationCode, final Permission... userPermissions) {
Organization organization = checkRoleAndGetOrganization(organizationCode, Role.MANAGE);
organization.getPermissions().updateUserPermissions(userPermissions);
organizationDao.updateOrganization(organization.getId(), organization);
return organization.getPermissions().getUserPermissions();
}
use of io.lumeer.api.model.Organization in project engine by Lumeer.
the class OrganizationFacade method removeGroupPermission.
public void removeGroupPermission(final String organizationCode, final String group) {
Organization organization = checkRoleAndGetOrganization(organizationCode, Role.MANAGE);
organization.getPermissions().removeGroupPermission(group);
organizationDao.updateOrganization(organization.getId(), organization);
}
use of io.lumeer.api.model.Organization in project engine by Lumeer.
the class UserFacade method checkPermissions.
private void checkPermissions(String organizationId) {
Organization organization = organizationDao.getOrganizationById(organizationId);
permissionsChecker.checkRole(organization, Role.MANAGE);
}
Aggregations