Re: Listing from a persistent BEFORE context created

Gene <[email protected]> Tue, 28 Dec 2004 15:11:59 -0600
Newsgroups gmane.comp.java.keel.user
Message-ID <[email protected]>
Worked like a charm, thanks Mike!

For future reference, this is the code that gets it:

	AuthorizationManager nullauth = (AuthorizationManager) 
req.getService(AuthorizationManager.ROLE, "nullauth");
	Persistent p = pf.create("my.persistent", request.getContext());
	//if you're not using the Context above, you're probably
	//not using a secured persistent, and the next is meaningless
	p.setBypassAuthorizationManager(nullauth);

	//list away

AND, persistent config needs:

am-bypass-allowed="true"


Michael Nash wrote:
> Gene:
> 
> On Tue, 2004-12-28 at 12:07, Gene wrote:
> 
>>Does anyone have an example or instruction on listing a secured 
>>persistent's data without being logged in? 
> 
> 
> Some of the unit tests for authentication might be a good place to start
> here. The persistent's config has to be set up to allow bypass of the
> auth manager, then you can (in your code) pass it nullauth for the
> special circumstance you need. I think the unit tests for
> svc-persist-authorization do exactly this, if I recall.
> 
> 
>> I need a public website to 
>>access and just list some data, but I'd rather not bypass keel.  Is 
>>there a way to possibly set the authmanager to a null bypass?  I feel 
>>like a child that has learned new cuss words, but doesn't really know 
>>what they mean yet!
> 
> 
> All programming will make you learn new cuss words, I've found :-)
> 
> Mike
> 
> 
>>thanks
>>gene
>>_______________________________________________
>>User mailing list
>>[email protected]
>>http://lists.keelframework.org/listinfo.cgi/user-keelframework.org
> 
> 
> _______________________________________________
> User mailing list
> [email protected]
> http://lists.keelframework.org/listinfo.cgi/user-keelframework.org
>