Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用@RolesAllowed. 它似乎只适用于恒定值。但是是否存在@RolesAllowed在 Java EE 中使用非恒定角色的解决方案?
@RolesAllowed
谢谢
不,不可能使用具有标准 Java EE 声明性安全性的非常量名称。相反,请@DeclareRoles与HttpServletRequest.isUserInRole或一起使用EJBContext.isCallerInRole。
@DeclareRoles
HttpServletRequest.isUserInRole
EJBContext.isCallerInRole