Repository: ambari
Updated Branches:
  refs/heads/trunk 068cafa90 -> f72b323f7


AMBARI-6933. Rolling restart not working.


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f72b323f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f72b323f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f72b323f

Branch: refs/heads/trunk
Commit: f72b323f7e468da16067607221a08d9d0926bf30
Parents: 068cafa
Author: Siddharth Wagle <swa...@hortonworks.com>
Authored: Tue Aug 19 22:46:34 2014 -0700
Committer: Siddharth Wagle <swa...@hortonworks.com>
Committed: Tue Aug 19 22:46:34 2014 -0700

----------------------------------------------------------------------
 .../internal/InternalAuthenticationToken.java      | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f72b323f/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/internal/InternalAuthenticationToken.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/internal/InternalAuthenticationToken.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/internal/InternalAuthenticationToken.java
index 1fc86a2..8752278 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/internal/InternalAuthenticationToken.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/internal/InternalAuthenticationToken.java
@@ -17,26 +17,37 @@
  */
 
 package org.apache.ambari.server.security.authorization.internal;
+
+import org.apache.ambari.server.orm.entities.PermissionEntity;
+import org.apache.ambari.server.orm.entities.PrivilegeEntity;
+import org.apache.ambari.server.security.authorization.AmbariGrantedAuthority;
 import org.springframework.security.core.Authentication;
 import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
 import org.springframework.security.core.userdetails.User;
-
 import java.util.Collection;
 import java.util.Collections;
 
 public class InternalAuthenticationToken implements Authentication {
 
   private static final String INTERNAL_NAME = "internal";
+  private static final PrivilegeEntity ADMIN_PRIV_ENTITY = new 
PrivilegeEntity();
 
   // used in ClustersImpl, checkPermissions
   private static final Collection<? extends GrantedAuthority> AUTHORITIES =
-      Collections.singleton(new SimpleGrantedAuthority("AMBARI.ADMIN"));
+    Collections.singleton(new AmbariGrantedAuthority(ADMIN_PRIV_ENTITY));
   private static final User INTERNAL_USER = new User(INTERNAL_NAME, "empty", 
AUTHORITIES);
 
   private String token;
   private boolean authenticated = false;
 
+  static{
+    PermissionEntity pe = new PermissionEntity();
+    pe.setId(PermissionEntity.AMBARI_ADMIN_PERMISSION);
+    pe.setPermissionName(PermissionEntity.AMBARI_ADMIN_PERMISSION_NAME);
+
+    ADMIN_PRIV_ENTITY.setPermission(pe);
+  }
+
   public InternalAuthenticationToken(String tokenString) {
     this.token = tokenString;
   }

Reply via email to