首页 > 解决方案 > Java EE Specify Role to a System Method

问题描述

So basically I got Method-A that runs on Systemside (has no user assigned). Method-A uses Method-B that only allows specific Roles: @RolesAllowed({RoleConstants.ADMINISTRATOR,...}) The problem was that Method-A is not allowed to use Method-B. So I came up with the idea of just declaring a Role (@DeclareRoles) to my Method-A but still it will just not work.

Is there anything I havent thought of?

标签: javajakarta-ee

解决方案


您可以说要Method-A作为一个允许的角色运行。在官方文档下方:

https://docs.oracle.com/cd/E19316-01/819-3669/bncbh/index.html


推荐阅读