Class AuthorizationHelper


  • public class AuthorizationHelper
    extends Object
    A helper class that performs common Authorization related functions shared by different system layers.
    Author:
    Daniel Bernstein
    • Method Detail

      • getUserGroups

        public List<String> getUserGroups​(org.springframework.security.core.Authentication auth)
      • getUserDetails

        protected DuracloudUserDetails getUserDetails​(org.springframework.security.core.Authentication auth)
      • getAuthorities

        public Collection<org.springframework.security.core.GrantedAuthority> getAuthorities​(org.springframework.security.core.Authentication auth)
      • groupsHaveReadAccess

        public boolean groupsHaveReadAccess​(org.springframework.security.core.Authentication auth,
                                            Map<String,​AclType> acls)
      • hasRole

        public boolean hasRole​(org.springframework.security.core.Authentication auth,
                               String role)
      • hasAdmin

        public boolean hasAdmin​(org.springframework.security.core.Authentication auth)
      • hasRole

        public boolean hasRole​(String role,
                               Collection<org.springframework.security.core.GrantedAuthority> authorities)