projects
/
invirt/packages/python-afs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
For consistency, use "cdef extern" everywhere instead of "cdef import"
[invirt/packages/python-afs.git]
/
afs
/
acl.py
diff --git
a/afs/acl.py
b/afs/acl.py
index
c49f374
..
a5293bd
100644
(file)
--- a/
afs/acl.py
+++ b/
afs/acl.py
@@
-11,12
+11,14
@@
_canonical = {
"none": "",
}
"none": "",
}
+_reverseCanonical = dict((y, x) for (x, y) in _canonical.iteritems())
+
_charBitAssoc = [
('r', READ),
_charBitAssoc = [
('r', READ),
- ('w', WRITE),
- ('i', INSERT),
('l', LOOKUP),
('l', LOOKUP),
+ ('i', INSERT),
('d', DELETE),
('d', DELETE),
+ ('w', WRITE),
('k', LOCK),
('a', ADMINISTER),
('A', USR0),
('k', LOCK),
('a', ADMINISTER),
('A', USR0),
@@
-32,6
+34,13
@@
_charBitAssoc = [
_char2bit = dict(_charBitAssoc)
_char2bit = dict(_charBitAssoc)
+def rightsToEnglish(s):
+ """Turns a rlwidwka string into a canonical name if possible"""
+ if s in _reverseCanonical:
+ return _reverseCanonical[s]
+ else:
+ return ''
+
def readRights(s):
"""Canonicalizes string rights to bitmask"""
if s in _canonical: s = _canonical[s]
def readRights(s):
"""Canonicalizes string rights to bitmask"""
if s in _canonical: s = _canonical[s]