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 br.com.diego.shiro; import javax.enterprise.context.RequestScoped; import javax.inject.Named; import org.apache.shiro.SecurityUtils; /** * * @author diego */ @Named @RequestScoped @ShiroSecured public class SomeBean { public void doSomethingWhichIsOnlyAllowedByADMIN() { SecurityUtils.getSubject().checkRole("ADMIN"); } }