Exemple #1
0
	def create_user (self, user) :
		patterns.validate_user_name (user)
		patterns.validate_user_password (password)
		if user in self.users :
			raise Exception ((user, password))
		self.users.add (user)
		self.user_passwords[user] = None
		self.user_emails[user] = None
		self.user_data[user] = None
Exemple #2
0
	def include_user_in_group (self, user, group) :
		patterns.validate_user_name (user)
		patterns.validate_group_name (group)
		if user not in self.users :
			raise Exception ()
		if group not in self.groups :
			raise Exception ()
		members = self.group_user_members[group]
		if user in members :
			raise Exception ()
		members.add (user)
Exemple #3
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
Exemple #4
0
	def select_user_data (self, user) :
		patterns.validate_user_name (user)
		return self.user_data[user]
Exemple #5
0
	def select_user_email (self, user) :
		patterns.validate_user_name (user)
		return self.user_emails[user]
Exemple #6
0
	def select_user_password (self, user) :
		patterns.validate_user_name (user)
		return self.user_passwords[user]
Exemple #7
0
	def update_user_data (self, user, data) :
		patterns.validate_user_name (user)
		if user not in self.users :
			raise Exception ()
		self.user_data[user] = data
Exemple #8
0
	def update_user_email (self, user, email) :
		patterns.validate_user_name (user)
		patterns.validate_email (email)
		if user not in self.users :
			raise Exception ()
		self.user_emails[user] = email
Exemple #9
0
	def update_user_password (self, user, password) :
		patterns.validate_user_name (user)
		patterns.validate_user_password (password)
		if user not in self.users :
			raise Exception ()
		self.user_passwords[user] = password