use of org.pentaho.platform.web.http.api.resources.LocalizedLogicalRoleName in project pentaho-platform by pentaho.
the class UserRoleDaoService method getRoleBindingStruct.
public SystemRolesMap getRoleBindingStruct(String locale) throws SecurityException {
if (canAdminister()) {
RoleBindingStruct roleBindingStruct = getRoleBindingDao().getRoleBindingStruct(locale);
SystemRolesMap systemRolesMap = new SystemRolesMap();
for (Map.Entry<String, String> localalizeNameEntry : roleBindingStruct.logicalRoleNameMap.entrySet()) {
systemRolesMap.getLocalizedRoleNames().add(new LocalizedLogicalRoleName(localalizeNameEntry.getKey(), localalizeNameEntry.getValue()));
}
for (Map.Entry<String, List<String>> logicalRoleAssignments : roleBindingStruct.bindingMap.entrySet()) {
systemRolesMap.getAssignments().add(new LogicalRoleAssignment(logicalRoleAssignments.getKey(), logicalRoleAssignments.getValue(), roleBindingStruct.immutableRoles.contains(logicalRoleAssignments.getKey())));
}
return systemRolesMap;
} else {
throw new SecurityException();
}
}
Aggregations