public void createPrivilege( CPrivilege privilege ) throws InvalidConfigurationException { createPrivilege( privilege, initializeContext() ); }
public void createRole( CRole role ) throws InvalidConfigurationException { createRole( role, initializeContext() ); }
public void createUser( CUser user, Set<String> roles ) throws InvalidConfigurationException { createUser( user, null, roles, initializeContext() ); }
public void createUserRoleMapping( CUserRoleMapping userRoleMapping ) throws InvalidConfigurationException { createUserRoleMapping( userRoleMapping, initializeContext() ); }
public void updateUser( CUser user, Set<String> roles, SecurityValidationContext context ) throws InvalidConfigurationException, UserNotFoundException { if ( context == null ) { context = initializeContext(); } ValidationResponse vr = validator.validateUser( context, user, roles, true ); if ( vr.isValid() ) { deleteUser( user.getId() ); getConfiguration().addUser( user ); this.createOrUpdateUserRoleMapping( this.buildUserRoleMapping( user.getId(), roles ) ); logValidationWarnings( vr ); } else { throw new InvalidConfigurationException( vr ); } }
public void updateRole( CRole role, SecurityValidationContext context ) throws InvalidConfigurationException, NoSuchRoleException { if ( context == null ) { context = initializeContext(); } ValidationResponse vr = validator.validateRole( context, role, true ); if ( vr.isValid() ) { deleteRole( role.getId(), false ); getConfiguration().addRole( role ); logValidationWarnings( vr ); } else { throw new InvalidConfigurationException( vr ); } }
public void updatePrivilege( CPrivilege privilege, SecurityValidationContext context ) throws InvalidConfigurationException, NoSuchPrivilegeException { if ( context == null ) { context = initializeContext(); } ValidationResponse vr = validator.validatePrivilege( context, privilege, true ); if ( vr.isValid() ) { deletePrivilege( privilege.getId(), false ); getConfiguration().addPrivilege( privilege ); logValidationWarnings( vr ); } else { throw new InvalidConfigurationException( vr ); } }
protected void deleteRole( String id, boolean clean ) throws NoSuchRoleException { boolean found = getConfiguration().removeRoleById( id ); if ( !found ) { throw new NoSuchRoleException( id ); } if ( clean ) { cleanRemovedRole( id ); } }
public void deletePrivilege( String id, boolean clean ) throws NoSuchPrivilegeException { boolean found = getConfiguration().removePrivilegeById( id ); if ( !found ) { throw new NoSuchPrivilegeException( id ); } if ( clean ) { cleanRemovedPrivilege( id ); } }
public void deleteRole( String id ) throws NoSuchRoleException { deleteRole( id, true ); }
public void createUser( CUser user, Set<String> roles, SecurityValidationContext context ) throws InvalidConfigurationException { createUser( user, null, roles, context ); }
public void deletePrivilege( String id ) throws NoSuchPrivilegeException { deletePrivilege( id, true ); }
public void createUser( CUser user, String password, Set<String> roles, SecurityValidationContext context ) throws InvalidConfigurationException { if ( context == null ) { context = initializeContext(); } // set the password if its not null if ( password != null && password.trim().length() > 0 ) { user.setPassword(this.passwordService.encryptPassword(password)); } ValidationResponse vr = validator.validateUser( context, user, roles, false ); if ( vr.isValid() ) { getConfiguration().addUser( user ); createOrUpdateUserRoleMapping( buildUserRoleMapping( user.getId(), roles ) ); logValidationWarnings( vr ); } else { throw new InvalidConfigurationException( vr ); } }
public void createUser( CUser user, String password, Set<String> roles ) throws InvalidConfigurationException { createUser( user, password, roles, initializeContext() ); }