Users

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Users

keith1y
Hello,

I have 13000+ users validation records in a database, so I thought I
would be clever. I define a pier user, role-dbuser, and use this as a
template for creating a "User whose validation is certified by the
database" on the fly.

Since it is created on the fly and is not known by PRKernel-users, nor
is the User-Groups relation maintained, so the groups are only aware of
the template user 'role-dbuser'.

This works fine until the check on groups permissions in
PUSecurity-validateCommand: which reads;

(self group notNil
        and: [ (self group includes: aCommand context user)

So I turned it around to read the following, and implemented PUUser
includesGroup:

(self group notNil
        and: [ (aCommand context user includesGroup: self group)

I thought that you might consider this tweak useful.

best regards

Keith

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Users

keith1y

> I thought that you might consider this tweak useful.
>
> best regards
>
> Keith
>
>  
Just to say that there is more code to change to get this idea working,
I just wondered if anyone had any thoughts on the idea in principle.

Keith


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Users

Lukas Renggli-2
In reply to this post by keith1y
> I have 13000+ users validation records in a database, so I thought I
> would be clever. I define a pier user, role-dbuser, and use this as a
> template for creating a "User whose validation is certified by the
> database" on the fly.

That sounds like an exciting project ;-)

Seems to be something essential to do authentication trough LDAP or  
an external for example.

> Since it is created on the fly and is not known by PRKernel-users, nor
> is the User-Groups relation maintained, so the groups are only  
> aware of
> the template user 'role-dbuser'.

What about creating a special group subclass? It could then override  
#includes: to check for the external user.

> So I turned it around to read the following, and implemented PUUser
> includesGroup:
>
> (self group notNil
>         and: [ (aCommand context user includesGroup: self group)

aCommand context user could be nil.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Users

keith1y

> aCommand context user could be nil.
>
> Cheers,
> Lukas
>
>  
Yes good point, everything worked until I hit the logout button!

Keith


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Users

keith1y
In reply to this post by Lukas Renggli-2
Following your suggestion the simplest fix to make this work:

PUGroup-includes: anUser

    anUser ifNil: [ ^ false ].
   
    ^ anUser groups includes: self

regards

Keith

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

PULogin command to show 'Login' button

keith1y
The cleanest approach I have found to achieve this is:

PULogin-asComponent
    ^ (self description asComponentOn: self)
        addValidatedForm: (Array with: #save -> 'Login' with: #cancel);
         yourself

It might be worth including this in Pier, since users have often
commented to me about it

regards

Keith

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: PULogin command to show 'Login' button

Lukas Renggli-2
Very good idea. Fixed in:

Name: Pier-All-lr.225
Author: lr
Time: 11 August 2007, 10:01:33 pm
UUID: 2c90b9ce-6ed0-4587-9495-0e550263c1ce
Ancestors: Pier-All-lr.224
Dependencies: Pier-Model-lr.160, Pier-Tests-lr.72, Pier-Seaside-lr.
189, Pier-Security-lr.86, Pier-Blog-lr.57

- display proper action lables (add, copy, move, apply, login) in  
commands, instead of the default save

On 11 Aug 2007, at 21:37, Keith Hodges wrote:

> The cleanest approach I have found to achieve this is:
>
> PULogin-asComponent
>     ^ (self description asComponentOn: self)
>         addValidatedForm: (Array with: #save -> 'Login' with:  
> #cancel);
>          yourself
>
> It might be worth including this in Pier, since users have often
> commented to me about it
>
> regards
>
> Keith
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki

--
Lukas Renggli
http://www.lukas-renggli.ch


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: PULogin command to show 'Login' button

keith1y
Lukas Renggli wrote:
> Very good idea. Fixed in:
>
> Name: Pier-All-lr.225
>  
Thats what I call a fast turn around!

Keith

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki