Search in sources :

Example 1 with MembershipEntity

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

the class DbIdentityServiceProvider method createMembership.

// membership //////////////////////////////////////////////////////
public void createMembership(String userId, String groupId) {
    checkAuthorization(Permissions.CREATE, Resources.GROUP_MEMBERSHIP, groupId);
    UserEntity user = findUserById(userId);
    GroupEntity group = findGroupById(groupId);
    MembershipEntity membership = new MembershipEntity();
    membership.setUser(user);
    membership.setGroup(group);
    getDbEntityManager().insert(membership);
    createDefaultMembershipAuthorizations(userId, groupId);
}
Also used : MembershipEntity(org.camunda.bpm.engine.impl.persistence.entity.MembershipEntity) TenantMembershipEntity(org.camunda.bpm.engine.impl.persistence.entity.TenantMembershipEntity) GroupEntity(org.camunda.bpm.engine.impl.persistence.entity.GroupEntity) UserEntity(org.camunda.bpm.engine.impl.persistence.entity.UserEntity)

Aggregations

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