drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arina-ielchiieva <...@git.apache.org>
Subject [GitHub] drill pull request #998: DRILL-5887: Display process user/groups info in Dri...
Date Mon, 23 Oct 2017 10:18:13 GMT
Github user arina-ielchiieva commented on a diff in the pull request:

    https://github.com/apache/drill/pull/998#discussion_r146222565
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/DrillRoot.java
---
    @@ -85,19 +86,24 @@ public ClusterInfo getClusterInfoJSON() {
         // For all other cases the user info need-not or should-not be displayed
         OptionManager optionManager = work.getContext().getOptionManager();
         final boolean isUserLoggedIn = AuthDynamicFeature.isUserLoggedIn(sc);
    -    String adminUsers = isUserLoggedIn ?
    -            ExecConstants.ADMIN_USERS_VALIDATOR.getAdminUsers(optionManager) : null;
    -    String adminUserGroups = isUserLoggedIn ?
    -            ExecConstants.ADMIN_USER_GROUPS_VALIDATOR.getAdminUserGroups(optionManager)
: null;
    +    final String processUser = ImpersonationUtil.getProcessUserName();
    +    final String processUserGroups = Joiner.on(", ").join(ImpersonationUtil.getProcessUserGroupNames());
    +    String adminUsers = ExecConstants.ADMIN_USERS_VALIDATOR.getAdminUsers(optionManager);
    +    String adminUserGroups = ExecConstants.ADMIN_USER_GROUPS_VALIDATOR.getAdminUserGroups(optionManager);
     
         // separate groups by comma + space
    -    if (adminUsers != null) {
    +    if (adminUsers.length() == 0) {
    --- End diff --
    
    This would be adherence to the MVC pattern which separates model from the view. Model
is generated on the server side while freemarker is responsible for representation layer.


---

Mime
View raw message