Package java.security

Examples of java.security.AccessControlException


                                 GetOpParam.NAME, GetOpParam.Values.INSTRUMENTATION));
        }
        Groups groups = HoopServer.get().get(Groups.class);
        List<String> userGroups = groups.getGroups(user.getName());
        if (!userGroups.contains(HoopServer.get().getAdminGroup())) {
          throw new AccessControlException("User not in Hoop admin group");
        }
        Instrumentation instrumentation = HoopServer.get().get(Instrumentation.class);
        Map snapshot = instrumentation.getSnapshot();
        response = Response.ok(snapshot).build();
        break;
View Full Code Here


      proxyHost = normalizeHostname(proxyHost);
      validateRequestorHost(proxyUser, proxyHost, proxyUserHosts.get(proxyUser));
      validateGroup(proxyUser, doAsUser, proxyUserGroups.get(proxyUser));
    }
    else {
      throw new AccessControlException(MessageFormat.format("User [{0}] not defined as proxyuser", proxyUser));
    }
  }
View Full Code Here

  private void validateRequestorHost(String proxyUser, String hostname, Set<String> validHosts)
    throws IOException, AccessControlException {
    if (validHosts != null) {
      if (!validHosts.contains(hostname) && !validHosts.contains(normalizeHostname(hostname))) {
        throw new AccessControlException(MessageFormat.format("Unauthorized host [{0}] for proxyuser [{1}]",
                                                              hostname, proxyUser));
      }
    }
  }
View Full Code Here

      for (String g : validGroups) {
        if (userGroups.contains(g)) {
          return;
        }
      }
      throw new AccessControlException(
        MessageFormat.format("Unauthorized proxyuser [{0}] for user [{1}], not in proxyuser groups",
                             proxyUser, user));
    }
  }
View Full Code Here

    try {
      InetAddress address = InetAddress.getByName(name);
      return address.getCanonicalHostName();
    }
    catch (IOException ex) {
      throw new AccessControlException(MessageFormat.format("Could not resolve host [{0}], {1}", name,
                                                            ex.getMessage()));
    }
  }
View Full Code Here

          for (String value : values) {
            if (groups.contains(value)) {
              return;
            }
          }
          throw new AccessControlException(MessageFormat.format("User [{0}] does not satisfy ACL [{1}]",
                                                                user, acl));
        }
        catch (IOException ex) {
          throw new AccessControlException(ex.getMessage());
        }
      }
      else {
        throw new AccessControlException(MessageFormat.format("No ACL, user [{0}] not owner [{1}]",
                                                              user, owner));
      }
    }
  }
View Full Code Here

      try
      {
         JCRPath jcrPath = locationFactory.parseAbsPath(absPath);
         AccessControlList acl = dataManager.getACL(jcrPath.getInternalPath());
         if (!accessManager.hasPermission(acl, actions, getUserState().getIdentity()))
            throw new AccessControlException("Permission denied " + absPath + " : " + actions);
      }
      catch (RepositoryException e)
      {
         throw new AccessControlException("Could not check permission for " + absPath + " " + e);
      }
   }
View Full Code Here

      checkValid();

      if (!session.getAccessManager().hasPermission(getACL(), actions, session.getUserState().getIdentity()))
      {
         throw new AccessControlException("Permission denied " + getPath() + " : " + actions);
      }
   }
View Full Code Here

    */
   public void clearACL() throws RepositoryException, AccessControlException
   {

      if (!isNodeType(Constants.EXO_PRIVILEGEABLE))
         throw new AccessControlException("Node is not exo:privilegeable " + getPath());

      checkPermission(PermissionType.CHANGE_PERMISSION);

      List<AccessControlEntry> aces = new ArrayList<AccessControlEntry>();
      for (String perm : PermissionType.ALL)
View Full Code Here

      checkValid();

      if (!isNodeType(Constants.EXO_PRIVILEGEABLE))
      {
         throw new AccessControlException("Node is not exo:privilegeable " + getPath());
      }

      checkPermission(PermissionType.CHANGE_PERMISSION);

      AccessControlList acl = new AccessControlList(getACL().getOwner(), getACL().getPermissionEntries());
View Full Code Here

TOP

Related Classes of java.security.AccessControlException

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.