110 |
GDebug.printMesg(1, _("User '%s' logged in.") % user) |
GDebug.printMesg(1, _("User '%s' logged in.") % user) |
111 |
|
|
112 |
# possibly not the best solution |
# possibly not the best solution |
113 |
session._tablelist=string.split(authData[0][3],',') |
session.tablelist = string.split (authData[0][3],',') |
114 |
|
|
115 |
return 1 # = has access |
return 1 # = has access |
|
|
|
116 |
|
|
117 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
|
# |
|
118 |
# check if user x has access for class/table y |
# check if user x has access for class/table y |
119 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
120 |
|
|
121 |
def hasAccess (self, session, user, classname): |
def hasAccess (self, session, user, classname): |
122 |
# this should be changed to check for the user again. |
# this should be changed to check for the user again. |
123 |
# it will only be secure if the protocol supports session-management too. |
# it will only be secure if the protocol supports session-management too. |
124 |
if hasattr(session,"_tablelist") and (classname in session._tablelist): |
if hasattr (session, "tablelist") and (classname in session.tablelist): |
125 |
return 1 |
return 1 |
126 |
else: |
else: |
127 |
GDebug.printMesg(1, _("User '%s' has no access to class %s.") % (user,classname)) |
GDebug.printMesg(1, _("User '%s' has no access to class %s.") % (user,classname)) |
128 |
return 0 |
return 0 |
129 |
|
|
130 |
# ============================================================================= |
# ============================================================================= |
131 |
# PAM Authentication Agent |
# PAM Authentication Agent |
132 |
# ============================================================================= |
# ============================================================================= |
159 |
print _("User '%s' logged in.") % user |
print _("User '%s' logged in.") % user |
160 |
|
|
161 |
return 1 # = has access |
return 1 # = has access |
|
|
|
162 |
|
|
163 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
|
# |
|
164 |
# check if user x has access for class/table y |
# check if user x has access for class/table y |
165 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
166 |
|
|
167 |
def hasAccess (self, session, user, classname): |
def hasAccess (self, session, user, classname): |
168 |
# this should be changed to check for the user again. |
# this should be changed to check for the user again. |
169 |
# it will only be secure if the protocol supports session-management too. |
# it will only be secure if the protocol supports session-management too. |
170 |
if hasattr(session,"_tablelist") and (classname in session._tablelist): |
if hasattr (session, "tablelist") and (classname in session.tablelist): |
171 |
return 1 |
return 1 |
172 |
else: |
else: |
173 |
return 0 |
return 0 |
|
|
|
|
|
|