File tree Expand file tree Collapse file tree
security/abac/role/src/main/java/io/helidon/security/abac/role Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2018, 2021 Oracle and/or its affiliates.
2+ * Copyright (c) 2018, 2022 Oracle and/or its affiliates.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -116,6 +116,18 @@ public RoleConfig fromAnnotations(EndpointConfig endpointConfig) {
116116 }
117117 builder .permitAll (false );
118118 builder .denyAll (false );
119+ } else if (annotation instanceof RolesContainer container ) {
120+ for (Roles role : container .value ()) {
121+ if (role .subjectType () == SubjectType .USER ) {
122+ roles .addAll (Arrays .asList (role .value ()));
123+ } else {
124+ serviceRoles .addAll (Arrays .asList (role .value ()));
125+ }
126+ }
127+ if (container .value ().length != 0 ) {
128+ builder .permitAll (false );
129+ builder .denyAll (false );
130+ }
119131 } else if (annotation instanceof PermitAll ) {
120132 builder .permitAll (true );
121133 builder .denyAll (false );
You can’t perform that action at this time.
0 commit comments