Changeset 3432 for pykota/trunk/pykota/tool.py
- Timestamp:
- 10/05/08 19:04:08 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/tool.py
r3430 r3432 187 187 return False 188 188 189 def sanitizeNames(self, options, names) :190 """ Ensures that an user can only see the datas he is allowed to see, by modifying the list of names."""189 def sanitizeNames(self, names, isgroups) : 190 """Sanitize users and groups names if needed.""" 191 191 if not self.config.isAdmin : 192 192 username = pwd.getpwuid(os.geteuid())[0] 193 if not options["list"] : 194 raise PyKotaCommandLineError, "%s : %s" % (username, _("You're not allowed to use this command.")) 195 else : 196 if options["groups"] : 197 user = self.storage.getUser(username) 198 if user.Exists : 199 return [ g.Name for g in self.storage.getUserGroups(user) ] 200 return [ username ] 201 elif not names : 202 return ["*"] 203 else : 204 return names 193 if isgroups : 194 user = self.storage.getUser(username) 195 if user.Exists : 196 return [ g.Name for g in self.storage.getUserGroups(user) ] 197 return [ username ] 198 return names 205 199 206 200 def display_version_and_quit(self) :