mneethiraj commented on code in PR #1371:
URL: https://github.com/apache/ranger/pull/1371#discussion_r4604232593


##########
security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java:
##########
@@ -3834,16 +3834,19 @@ private void updateUserStoreVersion(String label) {
     /**
      * Resolves the roles to assign to a freshly auto-provisioned external 
user. When header-based
      * authentication is enabled and the current request was authenticated 
through the trusted proxy,
-     * the (validated) roles carried in the {@link RangerAuthenticationToken} 
authorities are used.
-     * Returns {@code null} otherwise, in which case the caller falls back to 
the default ROLE_USER.
+     * the (validated) roles carried in the {@link RangerAuthenticationToken} 
authorities are used,
+     * but only when the authenticated principal is the user being 
provisioned. Users provisioned on
+     * behalf of another principal (e.g. users referenced in a new service's 
default policies) must
+     * not inherit the caller's roles. Returns {@code null} otherwise, in 
which case the caller falls
+     * back to the default ROLE_USER.
      */
-    private List<String> getHeaderAuthRoles() {
+    private List<String> getHeaderAuthRoles(String username) {

Review Comment:
   @kumaab - `getHeaderAuthRoles()` taking a username as parameter doesn't 
sound right.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to