use of org.pentaho.di.ui.repository.pur.repositoryexplorer.abs.IUIAbsRole in project pentaho-kettle by pentaho.
the class AbsController method setSelectedSystemRoleChanged.
/**
* The method is called when a user select a role from the role list. This method reads the current selected role and
* populates the Action Permission UI with the details
*/
public void setSelectedSystemRoleChanged(IUIRole role) throws Exception {
IUIAbsRole absRole = null;
uncheckAllSystemActionPermissions();
if (role instanceof IUIAbsRole) {
absRole = (IUIAbsRole) role;
if (absRole != null && absRole.getLogicalRoles() != null) {
for (String permission : absRole.getLogicalRoles()) {
XulCheckbox permissionCheckbox = findSystemRoleCheckbox(permission);
if (permissionCheckbox != null) {
permissionCheckbox.setChecked(true);
}
}
}
} else {
throw new IllegalStateException();
}
}
use of org.pentaho.di.ui.repository.pur.repositoryexplorer.abs.IUIAbsRole in project pentaho-kettle by pentaho.
the class AbsController method applySystemRoleActionPermission.
/**
* Save the permission for the selected system role
*/
public void applySystemRoleActionPermission() {
XulMessageBox messageBox = this.getMessageBox();
IUIRole role = null;
IUIAbsRole absRole = null;
try {
role = absSecurity.getSelectedSystemRole();
if (role instanceof IUIAbsRole) {
absRole = (IUIAbsRole) role;
} else {
throw new IllegalStateException();
}
((IAbsSecurityManager) service).setLogicalRoles(absRole.getName(), absRole.getLogicalRoles());
// $NON-NLS-1$
messageBox.setTitle(BaseMessages.getString(PKG, "Dialog.Success"));
// $NON-NLS-1$
messageBox.setAcceptLabel(BaseMessages.getString(PKG, "Dialog.Ok"));
// $NON-NLS-1$
messageBox.setMessage(BaseMessages.getString(PKG, "AbsController.RoleActionPermission.Success"));
messageBox.open();
// Refresh permissions in open tabs
SpoonPluginManager.getInstance().notifyLifecycleListeners(SpoonLifecycleListener.SpoonLifeCycleEvent.REPOSITORY_CHANGED);
} catch (KettleException e) {
// $NON-NLS-1$
messageBox.setTitle(BaseMessages.getString(PKG, "Dialog.Error"));
// $NON-NLS-1$
messageBox.setAcceptLabel(BaseMessages.getString(PKG, "Dialog.Ok"));
messageBox.setMessage(BaseMessages.getString(PKG, "AbsController.RoleActionPermission.UnableToApplyPermissions", role.getName(), // $NON-NLS-1$
e.getLocalizedMessage()));
messageBox.open();
}
}
use of org.pentaho.di.ui.repository.pur.repositoryexplorer.abs.IUIAbsRole in project pentaho-kettle by pentaho.
the class AbsController method applyRoleActionPermission.
/**
* Save the permission for the selected role
*/
public void applyRoleActionPermission() {
XulMessageBox messageBox = this.getMessageBox();
IUIRole role = null;
IUIAbsRole absRole = null;
try {
role = absSecurity.getSelectedRole();
if (role instanceof IUIAbsRole) {
absRole = (IUIAbsRole) role;
} else {
throw new IllegalStateException();
}
((IAbsSecurityManager) service).setLogicalRoles(absRole.getName(), absRole.getLogicalRoles());
// $NON-NLS-1$
messageBox.setTitle(BaseMessages.getString(PKG, "Dialog.Success"));
// $NON-NLS-1$
messageBox.setAcceptLabel(BaseMessages.getString(PKG, "Dialog.Ok"));
// $NON-NLS-1$
messageBox.setMessage(BaseMessages.getString(PKG, "AbsController.RoleActionPermission.Success"));
messageBox.open();
// Refresh permissions in open tabs
SpoonPluginManager.getInstance().notifyLifecycleListeners(SpoonLifecycleListener.SpoonLifeCycleEvent.REPOSITORY_CHANGED);
} catch (KettleException e) {
// $NON-NLS-1$
messageBox.setTitle(BaseMessages.getString(PKG, "Dialog.Error"));
// $NON-NLS-1$
messageBox.setAcceptLabel(BaseMessages.getString(PKG, "Dialog.Ok"));
messageBox.setMessage(BaseMessages.getString(PKG, "AbsController.RoleActionPermission.UnableToApplyPermissions", role.getName(), // $NON-NLS-1$
e.getLocalizedMessage()));
messageBox.open();
}
}
use of org.pentaho.di.ui.repository.pur.repositoryexplorer.abs.IUIAbsRole in project pentaho-kettle by pentaho.
the class AbsController method setSelectedRoleChanged.
/**
* The method is called when a user select a role from the role list. This method reads the current selected role and
* populates the Action Permission UI with the details
*/
public void setSelectedRoleChanged(IUIRole role) throws Exception {
IUIAbsRole absRole = null;
uncheckAllActionPermissions();
if (role instanceof IUIAbsRole) {
absRole = (IUIAbsRole) role;
if (absRole != null && absRole.getLogicalRoles() != null) {
for (String permission : absRole.getLogicalRoles()) {
XulCheckbox permissionCheckbox = findRoleCheckbox(permission);
if (permissionCheckbox != null) {
permissionCheckbox.setChecked(true);
}
}
}
} else {
throw new IllegalStateException();
}
}
Aggregations