private String getOfficialRoleForm(String role) { String official = mappedToOfficialForm.get(role); if (official == null) { for (String scoped : configuration.getScopedRoles().keySet()) { if (role.equalsIgnoreCase(scoped)) { official = scoped; break; } } if (official == null) { try { StandardRole std = StandardRole.valueOf(role.toUpperCase(Locale.ENGLISH)); official = std.getFormalName(); } catch (Exception e) { // ignored } } if (official != null) { mappedToOfficialForm.put(role, official); } else { official = role; } } return official; }
private String getOfficialRoleForm(String role) { String official = mappedToOfficialForm.get(role); if (official == null) { for (String scoped : configuration.getScopedRoles().keySet()) { if (role.equalsIgnoreCase(scoped)) { official = scoped; break; } } if (official == null) { try { StandardRole std = StandardRole.valueOf(role.toUpperCase(Locale.ENGLISH)); official = std.getFormalName(); } catch (Exception e) { // ignored } } if (official != null) { mappedToOfficialForm.put(role, official); } else { official = role; } } return official; }
private String getOfficialRoleForm(String role) { String official = mappedToOfficialForm.get(role); if (official == null) { for (String scoped : configuration.getScopedRoles().keySet()) { if (role.equalsIgnoreCase(scoped)) { official = scoped; break; } } if (official == null) { try { StandardRole std = StandardRole.valueOf(role.toUpperCase(Locale.ENGLISH)); official = std.getFormalName(); } catch (Exception e) { // ignored } } if (official != null) { mappedToOfficialForm.put(role, official); } else { official = role; } } return official; }
private StandardRBACAuthorizer(final AuthorizerConfiguration configuration, final DefaultPermissionFactory permissionFactory, final RoleMapper roleMapper) { super(permissionFactory, permissionFactory); this.configuration = configuration; this.permissionFactory = permissionFactory; configuration.registerScopedRoleListener(permissionFactory); this.roleMapper = roleMapper; for (StandardRole std : StandardRole.values()) { mappedToOfficialForm.put(std.toString(), std.getFormalName()); } }
private StandardRBACAuthorizer(final AuthorizerConfiguration configuration, final DefaultPermissionFactory permissionFactory, final RoleMapper roleMapper) { super(permissionFactory); this.configuration = configuration; this.permissionFactory = permissionFactory; configuration.registerScopedRoleListener(permissionFactory); this.roleMapper = roleMapper; for (StandardRole std : StandardRole.values()) { mappedToOfficialForm.put(std.toString(), std.getFormalName()); } }
private StandardRBACAuthorizer(final AuthorizerConfiguration configuration, final DefaultPermissionFactory permissionFactory, final RoleMapper roleMapper) { super(permissionFactory); this.configuration = configuration; this.permissionFactory = permissionFactory; configuration.registerScopedRoleListener(permissionFactory); this.roleMapper = roleMapper; for (StandardRole std : StandardRole.values()) { mappedToOfficialForm.put(std.toString(), std.getFormalName()); } }