Пример #1
0
	def include_path_permission_for_group (self, path, group, mode) :
		path = self.parse_path (path)
		patterns.validate_group_name (group)
		patterns.validate_permission_mode (mode)
		if group not in self.groups :
			raise Exception ()
		if path not in self.paths :
			raise Exception ()
		permissions = self.path_group_permissions[path]
		if group in permissions :
			raise Exception ()
		permissions[group] = mode
Пример #2
0
	def include_path_permission_for_user (self, path, user, mode) :
		path = self.parse_path (path)
		if user != '*' :
			patterns.validate_user_name (user)
		patterns.validate_permission_mode (mode)
		if user != '*' and user not in self.users :
			raise Exception ()
		if path not in self.paths :
			raise Exception ()
		permissions = self.path_user_permissions[path]
		if user in permissions :
			raise Exception ()
		permissions[user] = mode