Hi,
I'm struggling to integrate Deltaspikes Typesafe View Configs with my
application.
I have a login view and another view. I created a typesafe View Config
like this:
@Folder
@View(navigation = View.NavigationMode.REDIRECT)
public interface Pages extends ViewConfig {
@View
public class Login implements Pages {
}
@View()
@Secured(value = CustomAccessDecisionVoter.class)
public class Index implements Pages {
}
The my AccessDecisionVoter looks like this:
.....
@Override
public Set<SecurityViolation> checkPermission(final
AccessDecisionVoterContext accessDecisionVoterContext) {
if (loggedIn) {
return Collections.emptySet();
}
return Sets.newHashSet(new Violation());
}
.....
Now I want to achieve the following and don't have a clue how to do this:
1. Redirect to Login if the user doesn't have the permission (= the
AccessDecisionVoter returns SecurityViolations). At the moment I'm just
getting a
|org.apache.deltaspike.security.api.authorization.ErrorViewAwareAccessDeniedException|
2. How can I redirect to another page if the user is already logged in
and the user navigates to the login view? Is this possible with the
Typesave View Config?
I hope these questions aren't classic Deltaspike beginner questions ;-).
Honestly, I had a hard time finding useful information about Deltaspike
via Google. Seems like there aren't that many people blogging about it :-)
Thanks,
Dominik