/[gnue]/gnue-appserver/src/geasAuthentication.py
ViewVC logotype

Diff of /gnue-appserver/src/geasAuthentication.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by siesel, Sat Aug 16 17:07:16 2003 UTC revision 1.3 by reinhard, Mon Sep 1 16:54:43 2003 UTC
# Line 110  class geasDBAuthAgent(geasAuthAgent): Line 110  class geasDBAuthAgent(geasAuthAgent):
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  # =============================================================================  # =============================================================================
# Line 161  class geasPAMAuthAgent(geasAuthAgent): Line 159  class geasPAMAuthAgent(geasAuthAgent):
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
       
       

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26