Package de.iritgo.aktera.permissions.security

Examples of de.iritgo.aktera.permissions.security.Acl


    if (principal == null)
    {
      return false;
    }

    Acl acl = aclByDomainObject.get(new Tuple2(objectType, objectId));
    if (acl != null && acl.checkPermission(principal, new SimplePermission(permission)))
    {
      return true;
    }

    return false;
View Full Code Here


    if (principal == null)
    {
      return false;
    }

    Acl acl = aclByDomainObject.get(new Tuple2(AkteraUser.class.getName(), userId));
    if (acl != null && acl.checkPermission(principal, new SimplePermission(permission)))
    {
      return true;
    }

    for (Integer groupId : userDAO.listGroupIdsOfUserId(userId.intValue()))
    {
      acl = aclByDomainObject.get(new Tuple2(AkteraGroup.class.getName(), groupId));
      if (acl != null && acl.checkPermission(principal, new SimplePermission(permission)))
      {
        return true;
      }
    }
View Full Code Here

          for (Permission permissionEntity : permissionDAO.findGroupPermissions(akteraGroup))
          {
            Tuple2 aclKey = new Tuple2(permissionEntity.getObjectType() != null ? permissionEntity
                    .getObjectType() : GLOBAL_OBJECT_TYPE, permissionEntity.getObjectId());
            Acl acl = aclByDomainObject.get(aclKey);
            if (acl == null)
            {
              acl = new Acl(ROOT, ROOT_NAME);
              aclByDomainObject.put(aclKey, acl);
            }
            AclEntry aclEntry = acl.findAclEntry(group, permissionEntity.getNegative());
            if (aclEntry == null)
            {
              aclEntry = new AclEntry(group);
              if (permissionEntity.getNegative())
              {
                aclEntry.setNegativePermissions();
              }
              acl.addEntry(ROOT, aclEntry);
            }
            aclEntry.addPermission(new SimplePermission(permissionEntity.getPermission()));
          }
        }

        if (! group.isMember(principal))
        {
          group.addMember(principal);
        }
      }

      for (Permission permissionEntity : permissionDAO.findUserPermissions(akteraUser))
      {
        Tuple2 aclKey = new Tuple2(permissionEntity.getObjectType() != null ? permissionEntity.getObjectType()
                : GLOBAL_OBJECT_TYPE, permissionEntity.getObjectId());
        Acl acl = aclByDomainObject.get(aclKey);
        if (acl == null)
        {
          acl = new Acl(ROOT, ROOT_NAME);
          aclByDomainObject.put(aclKey, acl);
        }
        AclEntry aclEntry = acl.findAclEntry(principal, permissionEntity.getNegative());
        if (aclEntry == null)
        {
          aclEntry = new AclEntry(principal);
          if (permissionEntity.getNegative())
          {
            aclEntry.setNegativePermissions();
          }
          acl.addEntry(ROOT, aclEntry);
        }
        aclEntry.addPermission(new SimplePermission(permissionEntity.getPermission()));
      }
    }
    catch (NotOwnerException x)
View Full Code Here

TOP

Related Classes of de.iritgo.aktera.permissions.security.Acl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.