Example #1
0
    def test_user_read_write_json(self):
        """
            Tests reading and writing back a json users file
        """
        um = UserManager("")
        json = um.read()

        assert json is not None

        um.write(json)

        assert um.read() is not None
Example #2
0
def user_index():
    user = current_users
    usermanager = UserManager.read(user)

    if 'admin' not in current_user.get("roles") :
        flash("You do not have the permissions to see this page")
        return render_template('index.html')

    if current_user.get("roles") != ["admin"]:
        flash("You do not have the permissions to see this page")
        return render_template('index.html')


    return render_template('user.html', usermanager = usermanager)