Examples of deletePrivilege()


Examples of gwtappcontainer.server.apps.security.SecurityAPI.deletePrivilege()

   
    APIResponse response = api.addPrivilege("test",
        helper.loginWithPrivilege(Privileges.EDIT_PRIVILEGE));
   
    //should have the right privilege
    response = api.deletePrivilege("test", null);
    assertTrue(response.statusCode == Status.ERROR_LOGIN_REQUIRED);
   
    response = api.deletePrivilege("test", helper.loginAsInvalidUser());
    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
View Full Code Here

Examples of gwtappcontainer.server.apps.security.SecurityAPI.deletePrivilege()

   
    //should have the right privilege
    response = api.deletePrivilege("test", null);
    assertTrue(response.statusCode == Status.ERROR_LOGIN_REQUIRED);
   
    response = api.deletePrivilege("test", helper.loginAsInvalidUser());
    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
    response = api.deletePrivilege("test", helper.loginAsValidUser());
    assertTrue(response.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
   
View Full Code Here

Examples of gwtappcontainer.server.apps.security.SecurityAPI.deletePrivilege()

    assertTrue(response.statusCode == Status.ERROR_LOGIN_REQUIRED);
   
    response = api.deletePrivilege("test", helper.loginAsInvalidUser());
    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
    response = api.deletePrivilege("test", helper.loginAsValidUser());
    assertTrue(response.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
   
    response = api.deletePrivilege("test",
        helper.loginWithPrivilege(Privileges.EDIT_PRIVILEGE));
    assertTrue(response.statusCode == Status.SUCCESS);
View Full Code Here

Examples of gwtappcontainer.server.apps.security.SecurityAPI.deletePrivilege()

    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
    response = api.deletePrivilege("test", helper.loginAsValidUser());
    assertTrue(response.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
   
    response = api.deletePrivilege("test",
        helper.loginWithPrivilege(Privileges.EDIT_PRIVILEGE));
    assertTrue(response.statusCode == Status.SUCCESS);
   
    response = api.getAllPrivileges();
    TreeSet<String> all = (TreeSet<String>) response.object;
View Full Code Here

Examples of gwtappcontainer.server.apps.security.SecurityAPI.deletePrivilege()

    response = api.getAllPrivileges();
    TreeSet<String> all = (TreeSet<String>) response.object;
    assertTrue(! all.contains("TEST"));
   
    //deleting the same privilege again should give correct error
    response = api.deletePrivilege("test",
        helper.loginWithPrivilege(Privileges.EDIT_PRIVILEGE))
    assertTrue(response.statusCode == Status.ERROR_RESOURCE_DOES_NOT_EXIST);
       
    //admin can delete as well
    response = api.addPrivilege("test",
View Full Code Here

Examples of gwtappcontainer.server.apps.security.SecurityAPI.deletePrivilege()

    //admin can delete as well
    response = api.addPrivilege("test",
        helper.loginWithPrivilege(Privileges.EDIT_PRIVILEGE));
    assertTrue(response.statusCode == Status.SUCCESS);
   
    response = api.deletePrivilege("test", helper.loginAsSuperUser());
    assertTrue(response.statusCode == Status.SUCCESS);
    all = (TreeSet<String>) api.getAllPrivileges().object;
    assertTrue(! all.contains("TEST"))
  }
View Full Code Here

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

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

  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

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

    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

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

    // 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.