{"record":{"id":"2ae24667ece8042d","repo":"pentaho/pentaho-kettle","slug":"there-is-no-selected-user-or-role","errorCode":null,"errorMessage":"There is no selected user or role.","messagePattern":"There is no selected user or role\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/ui/repository/pur/repositoryexplorer/controller/AbstractPermissionsController.java","lineNumber":478,"sourceCode":"    }\n    return false;\n  }\n\n  private void clearSelectedObjAcl() {\n    Object ro = getSelectedObjects().get( 0 );\n    if ( ro instanceof IAclObject ) {\n      ( (IAclObject) ro ).clearAcl();\n    }\n  }\n\n  /*\n   * updatePermission method is called when the user checks or uncheck any permission checkbox. This method updates the\n   * current model with the update value from the UI\n   */\n  public void updatePermission() {\n    UIRepositoryObjectAcl acl = (UIRepositoryObjectAcl) userRoleList.getSelectedItem();\n    if ( acl == null ) {\n      throw new IllegalStateException( BaseMessages.getString( PKG, \"PermissionsController.NoSelectedRecipient\" ) );\n    }\n    acl.setPermissionSet( permissionsCheckboxHandler.processCheckboxes() );\n    clearSelectedObjAcl();\n    viewAclsModel.updateAcl( acl );\n  }\n\n  /*\n   * (non-Javadoc)\n   * \n   * @see org.pentaho.di.ui.repository.repositoryexplorer.ContextChangeListener#onContextChange() This method is called\n   * whenever user change the folder or file selection\n   */\n  protected TYPE returnType;\n\n  public TYPE onContextChange() {\n    try {\n      if ( viewAclsModel.isModelDirty() ) {\n","sourceCodeStart":460,"sourceCodeEnd":496,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/ui/repository/pur/repositoryexplorer/controller/AbstractPermissionsController.java#L460-L496","documentation":"updatePermission reads the currently selected user/role from the UI list; if nothing is selected (getSelectedItem() returns null) it throws IllegalStateException('There is no selected user or role.'). It guards against updating ACL permissions without a target recipient.","triggerScenarios":"Checking/unchecking a permission checkbox in the permissions dialog when the user/role selection list has no selection (e.g. list empty, selection cleared programmatically, or UI event fires before a recipient is chosen).","commonSituations":"Clicking permission checkboxes immediately after opening the dialog before picking a user or role; bindings not yet populated so no item is selected; custom XUL changes removing default selection.","solutions":["Select a user or role in the recipient list before toggling permission checkboxes","Guard updatePermission: only process when userRoleList.getSelectedItem() != null","Ensure the XUL selection binding populates a default selected item when the dialog opens"],"exampleFix":"// before\npublic void updatePermission() {\n  UIRepositoryObjectAcl acl = (UIRepositoryObjectAcl) userRoleList.getSelectedItem();\n  if ( acl == null ) {\n    throw new IllegalStateException( ... );\n  }\n// after\npublic void updatePermission() {\n  UIRepositoryObjectAcl acl = (UIRepositoryObjectAcl) userRoleList.getSelectedItem();\n  if ( acl == null ) {\n    return; // nothing selected; nothing to update\n  }","handlingStrategy":"type-guard","validationCode":"if (userRoleList.getSelectedItem() != null) { updatePermission(); }\n","typeGuard":"static boolean hasSelectedRecipient(org.pentaho.ui.xul.components.XulListBox list) {\n  return list.getSelectedItem() != null;\n}\n","tryCatchPattern":"try {\n  updatePermission();\n} catch (IllegalStateException e) {\n  log.warn(\"No user/role selected; ignoring checkbox change\");\n}\n","preventionTips":["Ensure a default recipient selection when the permissions dialog opens","Disable permission checkboxes until a user/role is selected","Re-check selection after programmatic list updates"],"tags":["pentaho","ui","acl","selection"],"backgroundTag":"missing-required-argument","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}