Skip to content
Neuron Teckid edited this page May 11, 2016 · 2 revisions

By default, RedisCtl allows everyone visiting any page or API.

When you add authentication module you may need to declare a database model for the user, with an integer as primary key, and template pages to display user info as well.

These are the member functions of RedisCtl you are going to override

# a URL for user login, the href attribute of the "Login" element at the navigation bar
def login_url(self)

# current user, and it will be saved in flask.g.user
# by default it returns None
def get_user(self):

# the id of current user
# by default it returns None
def get_user_id(self)

# a piece of HTML that is displayed as the correspondent of the creator of a task or the committer of a command
def render_user_by_id(self, user_id):

# a piece of HTML as the current user itself, at the naviation bar
# or you could directly modify templates/base.html, change the template content under elmeent
#     "<li id='nav-current-user'>"
def render_me(self)

# the validation of current user, the negation of this value determines if a "Login" element appears at the navigation bar
# by default it returns True, which means users are always valid, and no "Login" element shall be displayed
def access_ctl_user_valid(self)

# whether the current user is an advanced user
#   only advanced user is permitted to visit containerization images setting page
# by default it returns True
def access_ctl_user_adv(self)

# a user id for a default user, which is used as the creator of auto-created tasks
# by default it returns None
def default_user_id(self)

You may also need to declare extra Blueprint for an auth module and add it to the return value of App.ext_blueprints.