logo       
Google Custom Search
    AddThis Social Bookmark Button

svn commit: r1653 - trunk/lib/vcauth/svnauthz/__init__.py: msg#00012

Subject: svn commit: r1653 - trunk/lib/vcauth/svnauthz/__init__.py
Author: cmpilato
Date: 2007-05-10 10:00:57-0700
New Revision: 1653

Modified:
   trunk/lib/vcauth/svnauthz/__init__.py

Log:
* lib/vcauth/svnauthz/__init__.py
  (ViewVCAuthorizer.__init__): Look for the read ('r') code instead
    of trying to match specific permission strings ('r', 'rw', ...).
    Hopefully this gives us a little better resilience if Subversion grows
    more authz codes.  Suggested by Jan Grant <jan.grant@xxxxxxxxxxxxx>.

Modified: trunk/lib/vcauth/svnauthz/__init__.py
Url: 
http://viewvc.tigris.org/source/browse/viewvc/trunk/lib/vcauth/svnauthz/__init__.py?view=diff&rev=1653&p1=trunk/lib/vcauth/svnauthz/__init__.py&p2=trunk/lib/vcauth/svnauthz/__init__.py&r1=1652&r2=1653
==============================================================================
--- trunk/lib/vcauth/svnauthz/__init__.py       (original)
+++ trunk/lib/vcauth/svnauthz/__init__.py       2007-05-10 10:00:57-0700
@@ -108,11 +108,12 @@
         if user == '*' \
            or user == username \
            or (user[0:1] == "@" and user[1:] in groups):
-          mode = string.strip(cp.get(section, user))
-          allow = (mode == "r" or mode == "rw")
+          # See if the 'r' permission is among the ones granted to
+          # USER.  If so, we can stop looking.  (Entry order is not
+          # relevant -- we'll use the most permissive entry, meaning
+          # one 'allow' is all we need.)
+          allow = string.find(cp.get(section, user), 'r') != -1
           deny = not allow
-          # The order of the entries is not relevant.  We'll use the most
-          # permissive entry, meaning one 'allow' is all we need.
           if allow:
             break



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>