Skip to content

Commit

Permalink
Fixing ui#all authorization (MID-3193)
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Jun 20, 2016
1 parent 8afe4cd commit f73d022
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
Expand Up @@ -243,6 +243,8 @@ public static boolean isAuthorized(Collection<String> actions) {
return true;
}
Roles roles = new Roles(AuthorizationConstants.AUTZ_ALL_URL);
roles.add(AuthorizationConstants.AUTZ_GUI_ALL_URL);
roles.add(AuthorizationConstants.AUTZ_GUI_ALL_DEPRECATED_URL);
roles.addAll(actions);
if (((AuthenticatedWebApplication) AuthenticatedWebApplication.get()).hasAnyRole(roles)) {
return true;
Expand Down
Expand Up @@ -129,7 +129,7 @@ private void loadActions(PageDescriptor descriptor) {
}
}

//add http://.../..#guAll authorization only for displayable pages, not for pages used for development..
//add http://.../..#guiAll authorization only for displayable pages, not for pages used for development..
if (canAccess) {

actions.add(new AuthorizationActionValue(AuthorizationConstants.AUTZ_GUI_ALL_DEPRECATED_URL,
Expand Down
Expand Up @@ -143,8 +143,19 @@ public void decide(Authentication authentication, Object object, Collection<Conf
if (guiConfigAttr.isEmpty()) {
configAttributesToUse = configAttributes;
}

securityEnforcer.decide(authentication, object, configAttributesToUse);

try {
securityEnforcer.decide(authentication, object, configAttributesToUse);

if (LOGGER.isTraceEnabled()) {
LOGGER.trace("DECIDE: authentication={}, object={}, configAttributesToUse={}: OK", authentication, object, configAttributesToUse);
}
} catch (AccessDeniedException | InsufficientAuthenticationException e) {
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("DECIDE: authentication={}, object={}, configAttributesToUse={}: {}", authentication, object, configAttributesToUse, e);
}
throw e;
}
}

private void addSecurityConfig(FilterInvocation filterInvocation, Collection<ConfigAttribute> guiConfigAttr,
Expand Down

0 comments on commit f73d022

Please sign in to comment.