Package org.sonatype.security.authorization

Examples of org.sonatype.security.authorization.AuthorizationManager.deletePrivilege()


      if (priv.getType().equals(ApplicationPrivilegeDescriptor.TYPE)) {
        throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,
            "Cannot delete an application type privilege");
      }
      else {
        authzManager.deletePrivilege(getPrivilegeId(request));
      }
    }
    catch (NoSuchPrivilegeException e) {
      throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, e.getMessage());
    }
View Full Code Here


  public void testDeleteUser()
      throws Exception
  {
    AuthorizationManager authzManager = this.getAuthorizationManager();
    try {
      authzManager.deletePrivilege("INVALID-PRIVILEGENAME");
      Assert.fail("Expected NoSuchPrivilegeException");
    }
    catch (NoSuchPrivilegeException e) {
      // expected
    }
View Full Code Here

    catch (NoSuchPrivilegeException e) {
      // expected
    }

    // this one will work
    authzManager.deletePrivilege("2");

    // this one should fail
    try {
      authzManager.deletePrivilege("2");
      Assert.fail("Expected NoSuchPrivilegeException");
View Full Code Here

    // this one will work
    authzManager.deletePrivilege("2");

    // this one should fail
    try {
      authzManager.deletePrivilege("2");
      Assert.fail("Expected NoSuchPrivilegeException");
    }
    catch (NoSuchPrivilegeException e) {
      // expected
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.