def writable(self, login_user): # login_user can be str or User obj if isinstance(login_user, str): login_user = User.get_by_name(login_user) if not login_user: return False if login_user.is_admin() or login_user.is_root(): return True if self.create_user == login_user.name: return True if login_user.name in MAINTAINERS: return True a = self.action if not a: return False if not a.uic: return False return login_user.in_teams(a.uic)
def writable(self, login_user): #login_user can be str or User obj if isinstance(login_user, str): login_user = User.get_by_name(login_user) if not login_user: return False if login_user.is_admin() or login_user.is_root(): return True if self.create_user == login_user.name: return True if login_user.name in MAINTAINERS: return True a = self.action if not a: return False if not a.uic: return False return login_user.in_teams(a.uic)
def writable(self, user): # user can be str or User obj if isinstance(user, str): user = User.get_by_name(user) if not user: return False if self.create_user == user.name or user.name in MAINTAINERS or user.is_admin() or user.is_root(): return True return False
def writable(self, user): #user can be str or User obj if isinstance(user, str): user = User.get_by_name(user) if not user: return False if self.create_user == user.name or user.name in MAINTAINERS or user.is_admin() or user.is_root(): return True return False
def user_info_by_name(user_name): if request.method == "GET": user = User.get_by_name(user_name) return render_template("user/about.html", **locals())