[Moin-user] setting variables depeding if a user is logged in.

Juergen Hermann jh at web.de
Thu Apr 11 10:41:07 EDT 2002


On 10 Apr 2002 12:07:01 -0700, Adam Shand wrote:

># security (deactivated by default)
>if 1:
>    allowed_actions = ['AttachFile']
>
>    from MoinMoin.security import Permissions
>    class SecurityPolicy(Permissions):
>        edit = 1
>        delete = 0
>
>        def __init__(self, user):
>            self.user = user
>            self.edit = self.edit and user.valid
>
>        from MoinMoin import config
>        config.sitename = "test"

         def __init__(self, user):
             self.user = user
             self.edit = self.edit and user.valid
 
             if user.valid:
                 from MoinMoin import config
                 config.sitename = "test"


>If not I'll go home and bust out the python book and see if I can wrap
>my head around how classes work. :)

That you should do anyway, or you simply cannot expect to make this kind of 
adjustment.


Ciao, Jürgen






More information about the Moin-user mailing list