Exemple #1
0
    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)
Exemple #2
0
    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)
Exemple #3
0
    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
Exemple #4
0
    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
Exemple #5
0
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())