All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.duracloud.security.util.SecurityUtil Maven / Gradle / Ivy

There is a newer version: 8.1.0
Show newest version
/*
 * The contents of this file are subject to the license and copyright
 * detailed in the LICENSE and NOTICE files at the root of the source
 * tree and available online at
 *
 *     http://duracloud.org/license/
 */
package org.duracloud.security.util;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;

/**
 * 
 * @author Daniel Bernstein
 *
 */
public class SecurityUtil {
    
    public static boolean isRoot(Authentication auth) {
        for(GrantedAuthority g : auth.getAuthorities()){
            if(g.getAuthority().equals("ROLE_ROOT")){
                return true;
            }
        }
        return false;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy