Buggy code:
@ Controller @ RequestMapping ( ImportWizardController . URI ) public class ImportWizardController extends AbstractWizardController { public static final String ID = "importwizard" ; public static final String URI = ( MolgenisPluginController . PLUGIN_URI_PREFIX ) + ( ImportWizardController . ID ) ; private final UploadWizardPage uploadWizardPage ; private final OptionsWizardPage optionsWizardPage ; private final ValidationResultWizardPage validationResultWizardPage ; private final ImportResultsWizardPage importResultsWizardPage ; private DataService dataService ; private GrantedAuthoritiesMapper grantedAuthoritiesMapper ; private UserAccountService userAccountService ; @ Autowired public ImportWizardController ( UploadWizardPage uploadWizardPage , OptionsWizardPage optionsWizardPage , ValidationResultWizardPage validationResultWizardPage , ImportResultsWizardPage importResultsWizardPage , DataService dataService , GrantedAuthoritiesMapper grantedAuthoritiesMapper , UserAccountService userAccountService ) { } @ Override protected Wizard createWizard ( ) { } @ RequestMapping ( value = "//entityclass//group//{groupId}" , method = RequestMethod . GET ) @ ResponseBody public Permissions getGroupEntityClassPermissions ( @ PathVariable String groupId , WebRequest webRequest ) { } @ RequestMapping ( value = "//add//entityclass//group" , method = RequestMethod . POST ) @ ResponseStatus ( HttpStatus . OK ) public void addGroupEntityClassPermissions ( @ RequestParam String groupId , WebRequest webRequest ) { List < String > entities = Lists . newArrayList ( dataService . getEntityNames ( ) ) ; for ( String entityClassId : entities ) { GroupAuthority authority = getGroupAuthority ( groupId , entityClassId ) ; String param = "radio-" + entityClassId ; String value = webRequest . getParameter ( param ) ; if ( ( value != null ) && ( ( SecurityUtils . currentUserHasRole ( ( ( SecurityUtils . AUTHORITY_ENTITY_WRITE_PREFIX ) + ( entityClassId . toUpperCase ( ) ) ) ) ) || ( userAccountService . getCurrentUser ( ) . getSuperuser ( ) ) ) ) { if ( ( ( value . equalsIgnoreCase ( READ . toString ( ) ) ) || ( value . equalsIgnoreCase ( COUNT . toString ( ) ) ) ) || ( value . equalsIgnoreCase ( WRITE . toString ( ) ) ) ) { authority . setMolgenisGroup ( dataService . findOne ( ENTITY_NAME , groupId , MolgenisGroup . class ) ) ; authority . setRole ( ( ( ( ( SecurityUtils . AUTHORITY_ENTITY_PREFIX ) + ( value . toUpperCase ( ) ) ) + "_" ) + ( entityClassId . toUpperCase ( ) ) ) ) ; if ( ( authority . getId ( ) ) == null ) { authority . setId ( UUID . randomUUID ( ) . toString ( ) ) ; dataService . add ( GroupAuthority . ENTITY_NAME , authority ) ; } else dataService . update ( GroupAuthority . ENTITY_NAME , authority ) ; } else <START_BUG> if ( value . toUpperCase ( ) . equals ( NONE ) ) { <END_BUG> if ( ( authority . getId ( ) ) != null ) dataService . delete ( GroupAuthority . ENTITY_NAME , authority . getId ( ) ) ; } else { throw new RuntimeException ( ( ( ( "Unknown<seq2seq4repair_space>value:<seq2seq4repair_space>" + value ) + "<seq2seq4repair_space>for<seq2seq4repair_space>permission<seq2seq4repair_space>on<seq2seq4repair_space>entity:<seq2seq4repair_space>" ) + entityClassId ) ) ; } } else { if ( value != null ) throw new MolgenisDataAccessException ( ( "Current<seq2seq4repair_space>user<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>allowed<seq2seq4repair_space>to<seq2seq4repair_space>change<seq2seq4repair_space>the<seq2seq4repair_space>permissions<seq2seq4repair_space>for<seq2seq4repair_space>this<seq2seq4repair_space>entity:<seq2seq4repair_space>" + entityClassId ) ) ; } } } private List < Authority > getGroupPermissions ( MolgenisGroup molgenisGroup ) { } private Permissions createPermissions ( List < ? extends Authority > entityAuthorities , List < String > entitieIds ) { } private GroupAuthority getGroupAuthority ( String groupId , String entityClassId ) { } private String getAuthorityEntityId ( String role ) { } private String getAuthorityType ( String role ) { } }

Fix:
if ( value . equalsIgnoreCase ( NONE . toString ( ) ) ) {