[Moin-user] acl Group-info

Schwols, Keith C keith.c.schwols at intel.com
Thu Dec 20 12:12:21 EST 2007


I added the following to the config variables:
    access_denied_msg = '<strong>Check that you are %(login_action)s and
that you are a member of the %(group_access)s<br>Read the %(help_page)s
for Help on requesting access</strong>'
    access_groups = ['OneGroup']

And then modified Page.py to
-            request.write("<strong>%s</strong><br><br>" % _("You are
not allowed to view this page."))
+            request.write("<div id='message'
style='width:33%%;'><strong>%s</strong><br></div><br><br>" %_("You are
not allowed to view this page."))
+           if len(self.cfg.access_denied_msg) > 0:
+             grp_str = ""
+             if len(self.cfg.access_groups) > 0:
+               for c in self.cfg.access_groups:
+                  grp_str = grp_str + self.formatter.pagelink(1,c) + c
+ self.formatter.pagelink(0,c) + ", "
+             grp_str = grp_str[:-2]
+             help_str = (self.formatter.pagelink(1,self.cfg.help_page)
+
+                         self.cfg.help_page +
+                         self.formatter.pagelink(0,self.cfg.help_page))
+             request.write(self.cfg.access_denied_msg %
+                 { "login_action" : self.link_to(request,"logged
in","action=login"),
+                   "group_access" : grp_str,
+                   "front_page"   :
wikiutil.getFrontPage(request).link_to(request,_("Front Page")),
+                   "help_page"    : help_str,
+                 })

Not elegant and it would be better to control via the Theme overrides.
But it can be done.

]<eith

"Divide and rule, a sound motto. Unite and lead, a better one." - Goethe


>-----Original Message-----
>From: moin-user-bounces at lists.sourceforge.net [mailto:moin-user-
>bounces at lists.sourceforge.net] On Behalf Of Thilo Pfennig
>Sent: Wednesday, December 05, 2007 4:32 AM
>To: moin-user at lists.sourceforge.net
>Subject: Re: [Moin-user] acl Group-info
>
>Am Wed, 28 Nov 2007 14:30:36 +0100
>schrieb "Kris(R)" <KrisR at online.de>:
>
>> Is there a possibility to costomize massage "You are not allowed to
>> see this page" so that
>> it should look like "Only users from BlaBlaGroup are allowed to see
>> this page",
>> where BlaBlaGroup should be read from acl-line
>
>Sure, you will have to find that sentence, though. ;-) Maybe one can
>handle this via theme?
>
>Thilo
>
>-----------------------------------------------------------------------
--
>SF.Net email is sponsored by: The Future of Linux Business White Paper
>from Novell.  From the desktop to the data center, Linux is going
>mainstream.  Let it simplify your IT future.
>http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
>_______________________________________________
>Moin-user mailing list
>Moin-user at lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/moin-user




More information about the Moin-user mailing list