|
@@ -18,10 +18,20 @@
|
|
|
|
|
|
package org.apache.ambari.server.state.cluster;
|
|
|
|
|
|
-import com.google.gson.Gson;
|
|
|
-import com.google.inject.Inject;
|
|
|
-import com.google.inject.Singleton;
|
|
|
-import com.google.inject.persist.Transactional;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Collection;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
+import java.util.concurrent.ConcurrentHashMap;
|
|
|
+import java.util.concurrent.locks.Lock;
|
|
|
+import java.util.concurrent.locks.ReentrantReadWriteLock;
|
|
|
+
|
|
|
+import javax.persistence.RollbackException;
|
|
|
+
|
|
|
import org.apache.ambari.server.AmbariException;
|
|
|
import org.apache.ambari.server.ClusterNotFoundException;
|
|
|
import org.apache.ambari.server.DuplicateResourceException;
|
|
@@ -56,20 +66,11 @@ import org.apache.ambari.server.state.host.HostFactory;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.security.core.GrantedAuthority;
|
|
|
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
|
|
|
|
|
-import javax.persistence.RollbackException;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Collection;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
-import java.util.concurrent.ConcurrentHashMap;
|
|
|
-import java.util.concurrent.locks.Lock;
|
|
|
-import java.util.concurrent.locks.ReentrantReadWriteLock;
|
|
|
+import com.google.gson.Gson;
|
|
|
+import com.google.inject.Inject;
|
|
|
+import com.google.inject.Singleton;
|
|
|
+import com.google.inject.persist.Transactional;
|
|
|
|
|
|
@Singleton
|
|
|
public class ClustersImpl implements Clusters {
|
|
@@ -741,15 +742,6 @@ public class ClustersImpl implements Clusters {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- // SimpleGrantedAuthority is required by InternalAuthenticationToken for internal authorization by token
|
|
|
- if (grantedAuthority instanceof SimpleGrantedAuthority){
|
|
|
- SimpleGrantedAuthority authority = (SimpleGrantedAuthority) grantedAuthority;
|
|
|
- if ("AMBARI.ADMIN".equals(authority.getAuthority())) {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
// TODO : should we log this?
|
|
|
return false;
|