use of org.pentaho.di.ui.repository.pur.services.IAbsSecurityManager 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.services.IAbsSecurityManager in project pentaho-kettle by pentaho.
the class AbsController method initializeLogicalSystemRolesUI.
/**
* Initialized the ActionPermissions UI with all the possible values from LogicalSystemRoles enum
*/
private void initializeLogicalSystemRolesUI() {
try {
Map<String, String> logicalRoles = ((IAbsSecurityManager) service).getAllLogicalRoles(GlobalMessages.getLocale().getDisplayName());
for (Entry<String, String> logicalRole : logicalRoles.entrySet()) {
XulCheckbox logicalSystemRoleCheckbox;
// $NON-NLS-1$
logicalSystemRoleCheckbox = (XulCheckbox) document.createElement("checkbox");
logicalSystemRoleCheckbox.setLabel(logicalRole.getValue());
logicalSystemRoleCheckbox.setId(logicalRole.getValue());
// $NON-NLS-1$
logicalSystemRoleCheckbox.setCommand("iSecurityController.updateSystemRoleActionPermission()");
logicalSystemRoleCheckbox.setFlex(1);
logicalSystemRoleCheckbox.setDisabled(true);
logicalSystemRolesBox.addChild(logicalSystemRoleCheckbox);
logicalSystemRoleChecboxMap.put(logicalSystemRoleCheckbox, logicalRole.getKey());
bf.setBindingType(Binding.Type.ONE_WAY);
// $NON-NLS-1$ //$NON-NLS-2$
bf.createBinding(systemRoleListBox, "selectedIndex", logicalSystemRoleCheckbox, "disabled", buttonConverter);
}
} catch (XulException xe) {
} catch (KettleException xe) {
}
}
use of org.pentaho.di.ui.repository.pur.services.IAbsSecurityManager in project pentaho-kettle by pentaho.
the class AbsController method initializeLogicalRolesUI.
/**
* Initialized the ActionPermissions UI with all the possible values from LogicalRoles enum
*/
private void initializeLogicalRolesUI() {
try {
Map<String, String> logicalRoles = ((IAbsSecurityManager) service).getAllLogicalRoles(GlobalMessages.getLocale().getDisplayName());
for (Entry<String, String> logicalRole : logicalRoles.entrySet()) {
XulCheckbox logicalRoleCheckbox;
// $NON-NLS-1$
logicalRoleCheckbox = (XulCheckbox) document.createElement("checkbox");
logicalRoleCheckbox.setLabel(logicalRole.getValue());
logicalRoleCheckbox.setId(logicalRole.getValue());
// $NON-NLS-1$
logicalRoleCheckbox.setCommand("iSecurityController.updateRoleActionPermission()");
logicalRoleCheckbox.setFlex(1);
logicalRoleCheckbox.setDisabled(true);
logicalRolesBox.addChild(logicalRoleCheckbox);
logicalRoleChecboxMap.put(logicalRoleCheckbox, logicalRole.getKey());
bf.setBindingType(Binding.Type.ONE_WAY);
// $NON-NLS-1$ //$NON-NLS-2$
bf.createBinding(roleListBox, "selectedIndex", logicalRoleCheckbox, "disabled", buttonConverter);
}
} catch (XulException xe) {
} catch (KettleException xe) {
}
}
use of org.pentaho.di.ui.repository.pur.services.IAbsSecurityManager 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();
}
}
Aggregations