def checkLockerOwner(user, locker, verbose=False):
"""
- checkLockerOwner(user, locker) returns True if and only if user administers locker
+ checkLockerOwner(user, locker) returns True if and only if user administers locker.
+
+ If verbose is true, instead return the reason for failure, or None
+ if there is no failure.
"""
p = subprocess.Popen(["fs", "whichcell", "/mit/" + locker],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if entry[1] == "rlidwka":
if entry[0] == user or (entry[0][0:6] == "system" and
checkAfsGroup(user, entry[0], cell)):
+ if verbose:
+ return None
return True
if verbose:
return "You don't have admin bits on /mit/" + locker