Reputation: 53
How may I secure single eventhandlers by annotations? I know how to secure Complete pages, but i have no idea how to check before invocation if a a method has an annotation.
Is this possible?
I dont want to use Spring-security
Thanks
Upvotes: 2
Views: 197
Reputation: 71
ChenillKit access is a nice module. There is also the tapestry-security module based on the security framework Apache Shiro which provides annotation like
@RequiresPermissions("news:delete")
public void onActionFromDeleteNews(EventContext eventContext) {
...
}
Upvotes: 3
Reputation: 3893
With the Chenillekit access module you can use the @Restricted annotation on an Event method as well like so:
@Restricted(role = YOUR_ROLE_CONSTANT)
@OnEvent(value="eventName")
private Object handleEvent() throws Exception {
... your event code ....
}
Upvotes: 1