I do someexample from GWTP
http://blog.arcbees.com/2015/10/27/gwtp-beginners-tutorial-toaster-launcher-part-2/#Gatekeeper
@DefaultGatekeeper
public class LoggedInGatekeeper implements Gatekeeper {
private CurrentUser currentUser;
@Inject
public LoggedInGatekeeper(CurrentUser currentUser) {
this.currentUser = currentUser;
}
@Override
public boolean canReveal() {
return currentUser.isLoggedIn();
}
}
Here we give access if user is login.
Is it possible to find out which page (NameToken) wants to go by? And whether to give him a right, depending on the permissions
Sure, just inject a
PlaceManagerinto yourLoggedInGatekeeperand call getCurrentPlaceRequest and then compare it yourNameToken. Something along these lines: