[daisy] Running Example under daisy 2.0

Robert Cecil rob.cecil at gmail.com
Wed Dec 13 17:06:53 CST 2006


Paul/Marc

Thanks for explanation. If i'm not mistaken this js snippet from Greg  
was taken verbatim from the 1.5 docs (I think the section is  
4.2.1.5.3 Creating a user). So, presumably these docs need a bit of  
sprucing up (adding switchrole(), and use of the Daisy js object vs.  
raw calls to the Repo API).

Rob

On Dec 11, 2006, at 6:02 AM, Marc Portier wrote:

>
>
> Paul Focke wrote:
>> On Friday 08 December 2006 19:39, Greg Sieranski wrote:
>
> <snip what"script that didn't run for testuser" />
>
>> Hi,
>>
>> Perhaps you can check is if the user is in the correct role.
>> repository.isInRole("Administrator");
>> or you can just always switch role to administrator to be sure.
>> repository.switchRole(adminRole.getId());
>>
>> And another little tip. You might want to have a look at daisy- 
>> utils.js which
>> contains a few convenience methods for getting a repository  
>> instance.  Have a
>> look here
>> http://cocoondev.org/daisydocs-1_5/daisywiki/general/60/198.html
>>
>
> Greg,
>
> as for completing your understanding of Daisy's role model:
> http://cocoondev.org/daisydocs-1_5/repository/general/37.html
>
> specially this part:
>
>> A user has one or more roles. After logging in, it is both  
>> possible to
>> have just one role active and let the user manually switch between
>> his/her roles, or to have all roles of a user active at the same time
>> (which is the behaviour traditionally associated with user  
>> groups). If a
>> user has a default role, this role will be active after login. If no
>> default role for the user is specified, all its roles will become  
>> active
>> after login, with the exception of the Administrator role
>
> it's not because testuser "HAS" the administration role, that he "IS"
> actively taking that role in his current session.
>
> Taking that up in the current session requires the kind of API calls
> Paul showed.
>
>
> Historical perspective: this 'switching between active roles' has been
> foreseen to allow end users (specially administrators when e.g.  
> testing
> ACL's) to choose which rights they want to execute at a given time,
> without needing to re-authenticate.
>
> as explained above the traditional approach 'give me all my roles and
> associated rights" is available as well.
>
> HTH,
> -marc=
> -- 
> Marc Portier                            http://outerthought.org/
> Outerthought - Open Source, Java & XML Competence Support Center
> Read my weblog at                http://blogs.cocoondev.org/mpo/
> mpo at outerthought.org                              mpo at apache.org
> _______________________________________________
> daisy community mailing list
> Professional Daisy support: http://outerthought.org/site/services/ 
> daisy/daisysupport.html
> mail to: daisy at lists.cocoondev.org
> list information: http://lists.cocoondev.org/mailman/listinfo/daisy



More information about the daisy mailing list