1) instead of, I don't expect people to use / in the current user group
name.2) yes, it should.
3) if it starts with /, it is a path expression, if it doesn't, it is a
group name.
// is not supported.

On Wed, Nov 12, 2008 at 8:59 PM, Taco <[EMAIL PROTECTED]> wrote:

>
> I am willing to add the functionality of using path expressions for
> groupnames. To my opinion this would be everywhere where a string
> usersGroupName is used (eg. in the For() method of the
> PermissionBuilderService, etc.).
>
> Some questions came up while brainstorming:
> (1) Should this functionality come instead of the current one or in
> addition to (meaning a change in the interfaces to make a difference
> between usersGroupName and a path expression) ?
> (2) Should the method authRepos.CreateUsersGroup("/root/child1/
> child2") create three nested groups (with names 'root', 'child1',
> 'child2') for consistent behavior?
> (3) What path expressions would be reasonable to support? Always start
> with the rootnode (/root/child1/child2) or allow something like //
> child2 to get a group child2 on an arbitrary level?
>
> Thank you for your response,
> Taco.
>
>
> On Nov 12, 4:58 am, "Ayende Rahien" <[EMAIL PROTECTED]> wrote:
> > I never thought about the need to actually create path expressions for
> user
> > groups, so it is not there.I would be grateful for a testable patch that
> > added this functionality.
> >
> > On Wed, Nov 12, 2008 at 12:50 AM, Taco <[EMAIL PROTECTED]> wrote:
> >
> > > Dear developers,
> >
> > > I started experimenting with Rhino.Security (following the post on
> > >http://bartreyserhove.blogspot.com/) and wondered how to achieve the
> > > following.
> >
> > > I read that operations are written as /A/B/C and that the ancestors /A
> > > and /A/B are created automatically when using the
> > > authRepos.CreateOperation() method.
> > > I found this is not implemented the same way for usersGroups:
> > > authRepos.CreateUsersGroup("/D/E/F") creates a single group and not
> > > three nested groups.
> >
> > > In my scenario I wish to add a new user to the group Managers of Dept2
> > > of BranchB:
> > >   -BranchA
> > >   --Managers
> > >   --Assistants
> > >   -BranchB
> > >   --Dept1
> > >   ----Assistants
> > >   ----Managers
> > >   --Dept2
> > >   ----Developers
> > >   ----Managers
> >
> > > And the way I imagined it would work:
> > >   // The user is already persisted and now retrieved from the
> > > repository.
> > >   var myUser = (IUser)Repository<User>.Get(uid);
> >
> > >   // No idea how to query the usersGroup, but I would like
> > >   // to use the string /BranchB/Dept2/Managers
> > >   var group = /* mystery */
> >
> > >   // And finally associate the user with the group.
> > >   var authRepos = container.Resolve<IAuthorizationRepository>();
> > >   authRepos.AssociateUserWith(myUser, group);
> >
> > > Of course I could do something like:
> > >   authRepos.CreateUsersGroup("/BranchB");
> > >   UnitOfWork.Current.TransactionalFlush();
> > >   authRepos.CreateChildUserGroupOf("/BranchB", "/BranchB/Dept2");
> > >   UnitOfWork.Current.TransactionalFlush();
> > >   authRepos.CreateChildUserGroupOf("/BranchB/Dept2", "/BranchB/Dept2/
> > > Managers");
> > >   UnitOfWork.Current.TransactionalFlush();
> >
> > > And then when I need to present the group I can split on the slash and
> > > show only the last part. But if BranchB gets a new name I have to
> > > update all the names of all children, too, and that is unwanted
> > > behavior.
> >
> > > A nicer solution would be to retrieve the usersGroup from the
> > > repository by using the string /BranchB/Dept2/Managers, via
> > > Repository<UsersGroup> or via IAuthorizationRepository (currently not
> > > supported). Is something like that possible?
> >
> > > Thank you in advance for your tips.
> >
> > > With kind regards,
> > > Taco Ditiecher.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to