@Override public Set<String> mapRoles(Caller caller, Environment callEnvironment, JmxAction action, JmxTarget target) { // There's no mechanism for setting run-as roles over JMX return realRoleMapper.mapRoles(caller, callEnvironment, action, target); }
private Set<String> mapRoles(Caller caller, Set<String> currentRoles, Set<String> runAsRoles, boolean sanitized) { Set<String> result = currentRoles; if (runAsRoles != null) { Set<String> roleSet = new HashSet<String>(); for (String role : runAsRoles) { String requestedRole = sanitized ? role : getRoleFromText(role); if (realRoleMapper.canRunAs(currentRoles, requestedRole)) { roleSet.add(requestedRole); } } if (roleSet.isEmpty() == false) { result = Collections.unmodifiableSet(roleSet); if (ACCESS_LOGGER.isTraceEnabled()) { StringBuilder sb = new StringBuilder("User '").append(caller.getName()).append( "' Mapped to requested roles { "); for (String current : result) { sb.append("'").append(current).append("' "); } sb.append("}"); ACCESS_LOGGER.trace(sb.toString()); } } } return result; }
private Set<String> mapRoles(Caller caller, Set<String> currentRoles, Set<String> runAsRoles, boolean sanitized) { Set<String> result = currentRoles; if (runAsRoles != null) { Set<String> roleSet = new HashSet<String>(); for (String role : runAsRoles) { String requestedRole = sanitized ? role : getRoleFromText(role); if (realRoleMapper.canRunAs(currentRoles, requestedRole)) { roleSet.add(requestedRole); } } if (roleSet.isEmpty() == false) { result = Collections.unmodifiableSet(roleSet); if (ACCESS_LOGGER.isTraceEnabled()) { StringBuilder sb = new StringBuilder("User '").append(caller.getName()).append( "' Mapped to requested roles { "); for (String current : result) { sb.append("'").append(current).append("' "); } sb.append("}"); ACCESS_LOGGER.trace(sb.toString()); } } } return result; }
@Override public Set<String> mapRoles(Caller caller, Environment callEnvironment, JmxAction action, JmxTarget target) { // There's no mechanism for setting run-as roles over JMX return realRoleMapper.mapRoles(caller, callEnvironment, action, target); }
private Set<String> mapRoles(Caller caller, Set<String> currentRoles, Set<String> runAsRoles, boolean sanitized) { Set<String> result = currentRoles; if (runAsRoles != null) { Set<String> roleSet = new HashSet<String>(); for (String role : runAsRoles) { String requestedRole = sanitized ? role : getRoleFromText(role); if (realRoleMapper.canRunAs(currentRoles, requestedRole)) { roleSet.add(requestedRole); } } if (roleSet.isEmpty() == false) { result = Collections.unmodifiableSet(roleSet); if (ACCESS_LOGGER.isTraceEnabled()) { StringBuilder sb = new StringBuilder("User '").append(caller.getName()).append( "' Mapped to requested roles { "); for (String current : result) { sb.append("'").append(current).append("' "); } sb.append("}"); ACCESS_LOGGER.trace(sb.toString()); } } } return result; }
@Override public Set<String> getUserRoles(Caller caller, Environment callEnvironment, Action action, TargetResource target){ return roleMapper.mapRoles(caller, callEnvironment, action, target); }
@Override public PermissionCollection getUserPermissions(Caller caller, Environment callEnvironment, Action action, TargetResource target) { return getUserPermissions(roleMapper.mapRoles(caller, callEnvironment, action, target)); }
@Override public Set<String> mapRoles(Caller caller, Environment callEnvironment, Set<String> operationHeaderRoles) { return mapRoles(caller, realRoleMapper.mapRoles(caller, callEnvironment, null), operationHeaderRoles, false); }
@Override public Set<String> mapRoles(Caller caller, Environment callEnvironment, Set<String> operationHeaderRoles) { return mapRoles(caller, realRoleMapper.mapRoles(caller, callEnvironment, null), operationHeaderRoles, false); }
@Override public Set<String> mapRoles(Caller caller, Environment callEnvironment, Set<String> operationHeaderRoles) { return mapRoles(caller, realRoleMapper.mapRoles(caller, callEnvironment, null), operationHeaderRoles, false); }
@Override public PermissionCollection getUserPermissions(Caller caller, Environment callEnvironment, Action action, TargetAttribute target) { return getUserPermissions(roleMapper.mapRoles(caller, callEnvironment, action, target)); }
@Override public PermissionCollection getUserPermissions(Caller caller, Environment callEnvironment, Action action, TargetResource target) { return getUserPermissions(roleMapper.mapRoles(caller, callEnvironment, action, target)); }
@Override public PermissionCollection getUserPermissions(Caller caller, Environment callEnvironment, JmxAction action, JmxTarget target) { return getUserPermissions(roleMapper.mapRoles(caller, callEnvironment, action, target)); }
@Override public PermissionCollection getUserPermissions(Caller caller, Environment callEnvironment, Action action, TargetResource target) { return getUserPermissions(roleMapper.mapRoles(caller, callEnvironment, action, target)); }
@Override public Set<String> getCallerRoles(Caller caller, Environment callEnvironment, Set<String> runAsRoles) { Set<String> mapped = roleMapper.mapRoles(caller, callEnvironment, runAsRoles); if (mapped == null) { return null; } else if (mapped.isEmpty()) { return mapped; } Set<String> result = new HashSet<String>(); for (String role : mapped) { result.add(getOfficialRoleForm(role)); } return result; }
@Override public PermissionCollection getUserPermissions(Caller caller, Environment callEnvironment, Action action, TargetAttribute target) { return getUserPermissions(roleMapper.mapRoles(caller, callEnvironment, action, target)); }
@Override public Set<String> getCallerRoles(Caller caller, Environment callEnvironment, Set<String> runAsRoles) { Set<String> mapped = roleMapper.mapRoles(caller, callEnvironment, runAsRoles); if (mapped == null) { return null; } else if (mapped.isEmpty()) { return mapped; } Set<String> result = new HashSet<String>(); for (String role : mapped) { result.add(getOfficialRoleForm(role)); } return result; }
@Override public PermissionCollection getUserPermissions(Caller caller, Environment callEnvironment, Action action, TargetAttribute target) { return getUserPermissions(roleMapper.mapRoles(caller, callEnvironment, action, target)); }
@Override public PermissionCollection getUserPermissions(Caller caller, Environment callEnvironment, JmxAction action, JmxTarget target) { return getUserPermissions(roleMapper.mapRoles(caller, callEnvironment, action, target)); }
@Override public Set<String> getCallerRoles(Caller caller, Environment callEnvironment, Set<String> runAsRoles) { Set<String> mapped = roleMapper.mapRoles(caller, callEnvironment, runAsRoles); if (mapped == null) { return null; } else if (mapped.isEmpty()) { return mapped; } Set<String> result = new HashSet<String>(); for (String role : mapped) { result.add(getOfficialRoleForm(role)); } return result; }