You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!mayApplyConfig(req.getResourceResolver().adaptTo(User.class))) {
63
-
resp.sendError(HttpServletResponse.SC_FORBIDDEN, "You do not have sufficent permissions to apply the configuration");
64
-
return;
65
-
}
66
-
67
55
acToolUiService.doPost(req, resp);
68
56
LOG.debug("Applied AC tool config via Touch UI by user {}", req.getUserPrincipal());
69
57
}
70
58
71
-
privatebooleanmayApplyConfig(UserrequestUser) {
72
-
73
-
try {
74
-
75
-
if (requestUser != null) {
76
-
if (StringUtils.equals(requestUser.getID(), "admin")) {
77
-
LOG.debug("Admin user is allowed to apply AC Tool");
78
-
returntrue;
79
-
}
80
-
81
-
if (ArrayUtils.contains(webConsoleConfigTracker.getAllowedUsers(), requestUser.getID())) {
82
-
LOG.debug("User {} is allowed to apply AC Tool (allowed users: {})", requestUser.getID(), ArrayUtils.toString(webConsoleConfigTracker.getAllowedUsers()));
if (ArrayUtils.contains(webConsoleConfigTracker.getAllowedGroups(), memberOfGroup.getID())) {
91
-
LOG.debug("Group {} is allowed to apply AC Tool (allowed groups: {})", memberOfGroup.getID(), ArrayUtils.toString(webConsoleConfigTracker.getAllowedGroups()));
92
-
returntrue;
93
-
}
94
-
}
95
-
}
96
-
returnfalse;
97
-
} catch (Exceptione) {
98
-
thrownewIllegalStateException("Could not check if user may apply AC Tool configuration: " + e, e);
0 commit comments