use of com.epam.pipeline.entity.security.acl.AclPermissionEntry in project cloud-pipeline by epam.
the class GrantPermissionManager method convertAclToEntryForUser.
private AclSecuredEntry convertAclToEntryForUser(AbstractSecuredEntity entity, MutableAcl acl, Sid sid) {
AclSid aclSid = new AclSid(sid);
AclSecuredEntry entry = convertAclToEntry(entity, acl);
List<AclPermissionEntry> filteredPermissions = entry.getPermissions().stream().filter(p -> p.getSid().equals(aclSid)).collect(toList());
entry.setPermissions(filteredPermissions);
return entry;
}
use of com.epam.pipeline.entity.security.acl.AclPermissionEntry in project cloud-pipeline by epam.
the class ObjectCreationUtils method buildEntityPermissionVO.
public static EntityPermissionVO buildEntityPermissionVO(final String owner, final Set<String> allowedUsers, final Set<String> deniedUsers, final Set<String> allowedGroups, final Set<String> deniedGroups) {
Set<AclPermissionEntry> permissions = new HashSet<>();
allowedUsers.forEach(user -> permissions.add(getPermissionEntry(user, true, 1)));
deniedUsers.forEach(user -> permissions.add(getPermissionEntry(user, true, 2)));
allowedGroups.forEach(group -> permissions.add(getPermissionEntry(group, false, 1)));
deniedGroups.forEach(group -> permissions.add(getPermissionEntry(group, false, 2)));
EntityPermissionVO entityPermissionVO = new EntityPermissionVO();
entityPermissionVO.setOwner(owner);
entityPermissionVO.setPermissions(permissions);
return entityPermissionVO;
}
Aggregations