Search in sources :

Example 1 with TenantMembershipEntity

use of org.camunda.bpm.engine.impl.persistence.entity.TenantMembershipEntity in project camunda-bpm-platform by camunda.

the class DbIdentityServiceProvider method createTenantGroupMembership.

public void createTenantGroupMembership(String tenantId, String groupId) {
    checkAuthorization(Permissions.CREATE, Resources.TENANT_MEMBERSHIP, tenantId);
    TenantEntity tenant = findTenantById(tenantId);
    GroupEntity group = findGroupById(groupId);
    ensureNotNull("No tenant found with id '" + tenantId + "'.", "tenant", tenant);
    ensureNotNull("No group found with id '" + groupId + "'.", "group", group);
    TenantMembershipEntity membership = new TenantMembershipEntity();
    membership.setTenant(tenant);
    membership.setGroup(group);
    getDbEntityManager().insert(membership);
    createDefaultTenantMembershipAuthorizations(tenant, group);
}
Also used : TenantMembershipEntity(org.camunda.bpm.engine.impl.persistence.entity.TenantMembershipEntity) TenantEntity(org.camunda.bpm.engine.impl.persistence.entity.TenantEntity) GroupEntity(org.camunda.bpm.engine.impl.persistence.entity.GroupEntity)

Example 2 with TenantMembershipEntity

use of org.camunda.bpm.engine.impl.persistence.entity.TenantMembershipEntity in project camunda-bpm-platform by camunda.

the class DbIdentityServiceProvider method createTenantUserMembership.

public void createTenantUserMembership(String tenantId, String userId) {
    checkAuthorization(Permissions.CREATE, Resources.TENANT_MEMBERSHIP, tenantId);
    TenantEntity tenant = findTenantById(tenantId);
    UserEntity user = findUserById(userId);
    ensureNotNull("No tenant found with id '" + tenantId + "'.", "tenant", tenant);
    ensureNotNull("No user found with id '" + userId + "'.", "user", user);
    TenantMembershipEntity membership = new TenantMembershipEntity();
    membership.setTenant(tenant);
    membership.setUser(user);
    getDbEntityManager().insert(membership);
    createDefaultTenantMembershipAuthorizations(tenant, user);
}
Also used : TenantMembershipEntity(org.camunda.bpm.engine.impl.persistence.entity.TenantMembershipEntity) TenantEntity(org.camunda.bpm.engine.impl.persistence.entity.TenantEntity) UserEntity(org.camunda.bpm.engine.impl.persistence.entity.UserEntity)

Aggregations

TenantEntity (org.camunda.bpm.engine.impl.persistence.entity.TenantEntity)2 TenantMembershipEntity (org.camunda.bpm.engine.impl.persistence.entity.TenantMembershipEntity)2 GroupEntity (org.camunda.bpm.engine.impl.persistence.entity.GroupEntity)1 UserEntity (org.camunda.bpm.engine.impl.persistence.entity.UserEntity)1