neo09 / gwt-platform

Automatically exported from code.google.com/p/gwt-platform
0 stars 0 forks source link

Allow Gatekeepers to do an asynchronous RPC call before returning #176

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Gatekeepers are currently required to return true or false synchronously. This 
prohibits them from determining whether the use has access or not to the page 
via RPC. It would be interesting to allow these gatekeepers to take an 
AsyncCallback in parameter and proceed with an RPC call if desired.

This has been discussed here, with possible workarounds:

This is related to Issue 172.

Original issue reported on code.google.com by philippe.beaudoin on 25 Aug 2010 at 7:50

GoogleCodeExporter commented 9 years ago

Original comment by philippe.beaudoin on 22 Sep 2010 at 1:35

GoogleCodeExporter commented 9 years ago
Bumping to 0.6, preparing release 0.5.

Original comment by philippe.beaudoin on 25 Jan 2011 at 6:33

GoogleCodeExporter commented 9 years ago
Bumping to 0.7, preparing release 0.6.

Original comment by philippe.beaudoin on 6 Jun 2011 at 8:17

GoogleCodeExporter commented 9 years ago

Original comment by philippe.beaudoin on 1 Feb 2012 at 6:52

GoogleCodeExporter commented 9 years ago
Just stumbled across this issue, and this is exactly how I would like to use 
our project's Gatekeeper.  Has any progress been made on it?

Thanks,
John

Original comment by john.spr...@gmail.com on 28 Feb 2012 at 2:50

GoogleCodeExporter commented 9 years ago
No progress yet, but this is getting a lot of stars and it's one I'd like to 
work on... Unless someone wants to jump in and offer a patch? ;)

Original comment by philippe.beaudoin on 28 Feb 2012 at 10:02

GoogleCodeExporter commented 9 years ago
A workaround that avoids  PuzzleBazaar timers is to request the user directly 
in onModuleLoad. For example in my system, using RequestFactory:

public class Site implements EntryPoint {

    public final SiteGinjector ginjector = GWT.create(SiteGinjector.class);

    public final LoggedInUserHolder holder = ginjector.getLoggedInUserHolder();

    public final PlaceManager placeManager = ginjector.getPlaceManager();

    @Override
    public void onModuleLoad() {

        DelayedBindRegistry.bind(ginjector);

        DataRequestFactory requestFactory = ginjector.getDataRequestFactory();

        CurrentUserRequest request = requestFactory.getCurrentUserRequest();

        request.getCurrentUser().fire(new Receiver<UserProfileProxy>() {

            @Override
            public void onSuccess(UserProfileProxy response) {
                holder.setUser(response);
                placeManager.revealCurrentPlace();  
            }

            @Override
            public void onFailure(ServerFailure error) {
                String nameToken = placeManager.getCurrentPlaceRequest().getNameToken();
                placeManager.revealUnauthorizedPlace(nameToken);
            }

        });

    }

}

Original comment by reydelam...@gmail.com on 24 Mar 2012 at 10:10