Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.jevontech.wabl.services.implementation; /** * * @author jeroen */ //import com.brahalla.Cerberus.service.SecurityService; import com.jevontech.wabl.services.SecurityService; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Service; @Service public class SecurityServiceImpl implements SecurityService { @Override public Boolean hasProtectedAccess() { return (SecurityContextHolder.getContext().getAuthentication().getAuthorities() .contains(new SimpleGrantedAuthority("ADMIN"))); } }