Skip to content

Commit

Permalink
Merge branch 'post-3.7-fixes' into support-3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Jan 18, 2018
2 parents 431c746 + ac7125c commit 2317fdf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Expand Up @@ -480,7 +480,7 @@ private void deleteMemberConfirmPerformed(QueryScope scope, QName relation, Ajax
private List<InlineMenuItem> createManagersHeaderInlineMenu() {
List<InlineMenuItem> headerMenuItems = new ArrayList<>();

if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_ADD_MEMBER_ACTION_URI)) {
if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_ADD_ORG_MEMBER_ACTION_URI)) {
headerMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.createManager"),
false, new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
Expand All @@ -492,7 +492,7 @@ public void onClick(AjaxRequestTarget target) {
}));
}

if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_ASSIGN_MEMBER_ACTION_URI)) {
if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_ASSIGN_ORG_MEMBER_ACTION_URI)) {
headerMenuItems.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.addManagers"), false,
new HeaderMenuAction(this) {
private static final long serialVersionUID = 1L;
Expand All @@ -516,7 +516,7 @@ public void onClick(AjaxRequestTarget target) {
}));
}

if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_RECOMPUTE_MEMBER_ACTION_URI)) {
if (WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_ADMIN_RECOMPUTE_ORG_MEMBER_ACTION_URI)) {
headerMenuItems
.add(new InlineMenuItem(createStringResource("TreeTablePanel.menu.recomputeManagersAll"),
false, new HeaderMenuAction(this) {
Expand Down
Expand Up @@ -15,9 +15,7 @@
*/
package com.evolveum.midpoint.model.common.expression.script;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.*;

import com.evolveum.midpoint.model.common.expression.functions.CustomFunctions;
import com.evolveum.midpoint.model.common.expression.functions.FunctionLibrary;
Expand Down Expand Up @@ -80,7 +78,7 @@ public void setEvaluators(Collection<ScriptEvaluator> evaluators) {
}

public Collection<FunctionLibrary> getFunctions() {
return functions;
return Collections.unmodifiableCollection(functions); // MID-4396
}

public void setFunctions(Collection<FunctionLibrary> functions) {
Expand All @@ -95,7 +93,7 @@ public ScriptExpression createScriptExpression(ScriptExpressionEvaluatorType exp
ScriptExpression expression = new ScriptExpression(getEvaluator(getLanguage(expressionType), shortDesc), expressionType);
expression.setOutputDefinition(outputDefinition);
expression.setObjectResolver(objectResolver);
expression.setFunctions(functions);
expression.setFunctions(new ArrayList<>(functions));

if (customFunctionLibraryCache != null) {
expression.getFunctions().addAll(customFunctionLibraryCache.values());
Expand All @@ -112,7 +110,8 @@ public boolean handle(PrismObject<FunctionLibraryType> object, OperationResult p
customLibrary.setGenericFunctions(new CustomFunctions(object.asObjectable(), expressionFactory, result, task));
customLibrary.setNamespace(MidPointConstants.NS_FUNC_CUSTOM);
customFunctionLibraryCache.put(object.getName().getOrig(), customLibrary);
return expression.getFunctions().add(customLibrary);
expression.getFunctions().add(customLibrary);
return true;
}
};
try {
Expand Down

0 comments on commit 2317fdf

Please sign in to comment.