Examples of deleteRole()


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

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

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

    assertTrue(response.statusCode == Status.ERROR_INVALID_USER);
   
    response = api.deleteRole("test", helper.loginAsValidUser());
    assertTrue(response.statusCode == Status.ERROR_INSUFFICIENT_PERMISSION);
   
    response = api.deleteRole("test",
        helper.loginWithPrivilege(Privileges.EDIT_ROLE));
    assertTrue(response.statusCode == Status.SUCCESS);
   
    response = api.getAllRoles();
    TreeSet<RoleProp> all = (TreeSet<RoleProp>) response.object;
View Full Code Here

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

    response = api.getAllRoles();
    TreeSet<RoleProp> all = (TreeSet<RoleProp>) response.object;
    assertTrue(all.size() == 0);
   
    //deleting the same role again should give correct error
    response = api.deleteRole("test",
        helper.loginWithPrivilege(Privileges.EDIT_ROLE));   
    assertTrue(response.statusCode == Status.ERROR_RESOURCE_DOES_NOT_EXIST);
       
    //admin can delete as well
    //first add before deleting
View Full Code Here

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

    //first add before deleting
    response = api.addRole("test",
        helper.loginWithPrivilege(Privileges.EDIT_ROLE));
    assertTrue(response.statusCode == Status.SUCCESS);
   
    response = api.deleteRole("test", helper.loginAsSuperUser());
    assertTrue(response.statusCode == Status.SUCCESS);
    all = (TreeSet<RoleProp>) api.getAllRoles().object;
    assertTrue(all.size() == 0);   
  }
 
View Full Code Here

Examples of org.jresearch.flexess.core.services.IRoleService.deleteRole()

    }
    rm = roleInstService.saveRoleInstance(rm);

    // getUserRoleService().addUserRole("cathy", rm);

    roleService.deleteRole("com.jresearchsoft.flexess.examples.orders", dynaMeta.getId()); //$NON-NLS-1$

  }

  @After
  public void cleanUpDynaRoles() throws Exception {
View Full Code Here

Examples of org.pentaho.platform.api.engine.security.userroledao.IUserRoleDao.deleteRole()

            PentahoSystem.get( IUserRoleDao.class, "userRoleDaoProxy", PentahoSessionHolder.getSession() );
        StringTokenizer tokenizer = new StringTokenizer( roleNames, "\t" );
        while ( tokenizer.hasMoreTokens() ) {
          IPentahoRole role = roleDao.getRole( null, tokenizer.nextToken() );
          if ( role != null ) {
            roleDao.deleteRole( role );
          }
        }
      } catch ( Throwable th ) {
        return processErrorResponse( th.getLocalizedMessage() );
      }
View Full Code Here

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

  public void delete(Context context, Request request, Response response)
      throws ResourceException
  {
    try {
      AuthorizationManager authzManager = getSecuritySystem().getAuthorizationManager(ROLE_SOURCE);
      authzManager.deleteRole(getRoleId(request));
    }
    catch (NoSuchRoleException e) {
      throw new ResourceException(Status.CLIENT_ERROR_NOT_FOUND, e.getMessage());
    }
    catch (NoSuchAuthorizationManagerException e) {
View Full Code Here

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

    Set<RoleIdentifier> emptyRoleSet = Collections.emptySet();
    user.setRoles(emptyRoleSet);
    securitySystem.updateUser(user);

    // delete the empty role
    authManager.deleteRole(emptyRole.getRoleId());
  }

  /**
   * Note: this test is kinda useless, as Security system (as underlying Shiro) is not "reloadable": once created,
   * you
 
View Full Code Here

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

  public void testDeleteRole()
      throws Exception
  {
    AuthorizationManager authzManager = this.getAuthorizationManager();
    try {
      authzManager.deleteRole("INVALID-ROLENAME");
      Assert.fail("Expected NoSuchRoleException");
    }
    catch (NoSuchRoleException e) {
      // expected
    }
View Full Code Here

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

    catch (NoSuchRoleException e) {
      // expected
    }

    // this one will work
    authzManager.deleteRole("role2");

    // this one should fail
    try {
      authzManager.deleteRole("role2");
      Assert.fail("Expected NoSuchRoleException");
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.