/[glsr]/trunk/site/auth.py
Gentoo

Contents of /trunk/site/auth.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 141 - (show annotations) (download) (as text)
Mon Sep 19 18:36:29 2005 UTC (8 years, 7 months ago) by hadfield
File MIME type: text/x-python
File size: 896 byte(s)
moved the user type definitions from 'auth' to 'user'.
1
2 __revision__ = "$Id$"
3 __authors__ = ["Scott Hadfield <hadfield@gentoo.org>",
4 "Ian Leitch <port001@gentoo.org>"]
5 __modulename__ = "auth"
6
7 from glsr.site.user import User
8
9 def restricted(vals):
10
11 def auth_check_around(func):
12
13 def auth_check(*a, **k):
14
15 if type(vals) is not tuple:
16 raise ValueError('Expected tuple of integer values as input')
17
18 if User(a[0]._get_user()[0]).get_type() not in vals:
19 return a[0].access_error()
20
21 return func(*a, **k)
22
23 auth_check.__name__ = func.__name__
24 return auth_check
25
26 return auth_check_around
27
28 def registered(func):
29 def new_check(*args):
30 print args[0]._get_user()
31 if args[0]._get_user() == (0, ''):
32 return args[0].access_error()
33 return func(*args)
34 new_check.func_name = func.func_name
35 return new_check

Properties

Name Value
svn:keyword Id
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.20