On Sat, 2009-01-10 at 17:25 +1100, Karl Auer wrote: > Is there any way to apply an ACL to the newaccount action? > [...] > An alternative would be to code the action so that it looks for a > particular account, or refuses to operate except for (say) superuser > accounts.
I've added these lines to ./MoinMoin/actions/newaccount.py, in _create_user(), just after the check for POST: # KA 10/1/2009 - only allow logged in superusers to do this! if not request.user.isSuperUser(): return _('Only a superuser can create new accounts.') It seems to work. If I am not logged in or I am logged in as a non-superuser, I can't create accounts and I see my error message. Is this the only place I need to do this check? There are so many ways this could be better - for example, the code could check a preferences setting to see if the restriction should be applied (how do I add such a preference?). Or there could be a list of account admins instead of just re-using the superuser list. The perfect solution IMHO would be being able to apply ACLs to actions. Anyway, this works well enough for my needs, but it would be nice to see an official solution (not necessarily this one) in a future version of MoinMoin. Still happy to hear any better ideas, especially if my very minimal Python skills are likely to be up to implementing them :-) Regards, K. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Karl Auer (ka...@biplane.com.au) +61-2-64957160 (h) http://www.biplane.com.au/~kauer/ +61-428-957160 (mob) GPG fingerprint: 07F3 1DF9 9D45 8BCD 7DD5 00CE 4A44 6A03 F43A 7DEF
signature.asc
Description: This is a digitally signed message part
------------------------------------------------------------------------------ Check out the new SourceForge.net Marketplace. It is the best place to buy or sell services for just about anything Open Source. http://p.sf.net/sfu/Xq1LFB
_______________________________________________ Moin-user mailing list Moin-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/moin-user