-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PAYARA-2081 create a new roles allowed cdi annotation #2247
PAYARA-2081 create a new roles allowed cdi annotation #2247
Conversation
jenkins test please |
Quick build and test passed! |
} | ||
|
||
public boolean checkRoles(Roles roles) { | ||
if (roles != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roles can't/shouldn't really be null in an annotation
*/ | ||
public class RolesCDIExtension implements Extension { | ||
|
||
void beforeBeanDiscovery(@Observes BeforeBeanDiscovery bbd, BeanManager bm) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to avoid abbreviations of variable names, unless very common.
* @default OR | ||
*/ | ||
@Nonbinding | ||
String semantics() default "OR"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could possibly be an enum here instead of a String
<artifactId>packages</artifactId> | ||
<version>4.1.2.181-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>roles-package</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "roles-package" the clearest name here one can think of?
@@ -70,6 +70,7 @@ | |||
<module>environment-warning</module> | |||
<module>payara-rest-endpoints</module> | |||
<module>rest-monitoring</module> | |||
<module>roles-api</module> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really a "roles api"?
|
||
void beforeBeanDiscovery(@Observes BeforeBeanDiscovery bbd, BeanManager bm) { | ||
bbd.addInterceptorBinding(Roles.class); | ||
AnnotatedType<RolesCDIInterceptor> cpat = bm.createAnnotatedType(RolesCDIInterceptor.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cpat?
* only if the new code is made subject to such option by the copyright | ||
* holder. | ||
*/ | ||
package fish.payara.appserver.roles.api; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a similar vein to Arjan's comments on the module name, I'm not a fan of this package name - this isn't an api, it's an interceptor.
this.securityContext = CDI.current().select(SecurityContext.class).get(); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 more empty lines than necessary
import org.glassfish.security.common.Role; | ||
|
||
/** | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description would be nice :)
9805fa9
to
dd1eeda
Compare
Added request changes and updated copyright to 2018
dd1eeda
to
10b3c4e
Compare
10b3c4e
to
8ee6c4e
Compare
jenkins test please |
Quick build and test passed! |
No description provided.