checkPermission(globalConfiguration, null, perm);
}
public static int computeSubjectRoleMask(Subject subject, GlobalSecurityConfiguration globalConfiguration,
AuthorizationConfiguration configuration) {
PrincipalRoleMapper roleMapper = globalConfiguration.authorization().principalRoleMapper();
int mask = 0;
if (subject != null) {
for (Principal principal : subject.getPrincipals()) {
Set<String> roleNames = roleMapper.principalToRoles(principal);
if (roleNames != null) {
for (String roleName : roleNames) {
// Skip roles not defined for this cache
if (configuration != null && !configuration.roles().contains(roleName))
continue;