You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2021/07/16 09:58:58 UTC

[GitHub] [brooklyn-server] ahgittin commented on a change in pull request #1202: Adds an attributes map on WebEntitlementContext to handle user roles

ahgittin commented on a change in pull request #1202:
URL: https://github.com/apache/brooklyn-server/pull/1202#discussion_r671122887



##########
File path: core/src/main/java/org/apache/brooklyn/core/mgmt/entitlement/WebEntitlementContext.java
##########
@@ -21,15 +21,24 @@
 import org.apache.brooklyn.api.mgmt.entitlement.EntitlementContext;
 import org.apache.brooklyn.util.javalang.JavaClassNames;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * Indicates an authenticated web request as the entitlements context;
  * note user may still be null if no authentication was requested
  */
 public class WebEntitlementContext implements EntitlementContext {
 
+    public static final String ENTITLEMENTS_ATTRIBUTES = "brooklyn.entitlements.attributes";
+
+    public static final String USER_ROLES = "brooklyn.entitlements.user.roles";
+
+
     final String user;
     final String sourceIp;
     final String requestUri;
+    final Map<String, Object> attributes;

Review comment:
       probably `= MutableMap.of()` here
   
   that will use `LinkedHashMap` which preserves order (i never use plain `HashMap`)
   
   and then we can prevent a caller from adding map entries after they are passed in here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org