Package java.security

Examples of java.security.AccessControlException


                    public Void run() throws Exception
                    {
                        boolean allowed = ApplicationRegistry.getInstance().getSecurityManager().accessManagement();
                        if (!allowed)
                        {
                            throw new AccessControlException("User is not authorised for management");
                        }
                        return null;
                    }
                });
            }
View Full Code Here


            subject = authenticateUserAndGetSubject(subjectCreator, credentials[0], credentials[1]);
        }
        else
        {
            //TODO: write a return response indicating failure?
            throw new AccessControlException("Invalid number of credentials supplied: "
                                            + credentials.length);
        }
        return subject;
    }
View Full Code Here

    {
        SubjectAuthenticationResult authResult = subjectCreator.authenticate(username, password);
        if( authResult.getStatus() != AuthenticationStatus.SUCCESS)
        {
            //TODO: write a return response indicating failure?
            throw new AccessControlException("Incorrect username or password");
        }
        Subject subject = authResult.getSubject();
        return subject;
    }
View Full Code Here

        {
            _queue.getAMQQueue().getVirtualHost().getBindingFactory().removeBinding(_binding);
        }
        catch(AMQSecurityException e)
        {
            throw new AccessControlException(e.getMessage());
        }
        catch(AMQInternalException e)
        {
            throw new IllegalStateException(e);
        }
View Full Code Here

            // } else if (statusCode == HttpStatus.SC_FORBIDDEN) {
            // ex = new UnauthorizedRoleException(-1L);

            // 2. Map SC_UNAUTHORIZED
        } else if (statusCode == HttpStatus.SC_UNAUTHORIZED) {
            ex = new AccessControlException("Remote unauthorized exception");

            // 3. Map SC_BAD_REQUEST
        } else if (statusCode == HttpStatus.SC_BAD_REQUEST) {
            ex = new BadRequestException();
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());
      }
      // this will also check if item is valid
      checkPermission(PermissionType.CHANGE_PERMISSION);

      List<AccessControlEntry> aces = new ArrayList<AccessControlEntry>();
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

      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

      checkValid();

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

      if (identity == null)
      {
         throw new RepositoryException("Identity cannot be null");
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.