
import flask
from flask.ext.admin.contrib import sqla

import models

# Global admin object
from refstack.extensions import admin
from refstack.extensions import db


class SecureView(sqla.ModelView):
    def is_accessible(self):
        # let us look at the admin if we're in debug mode
        if flask.current_app.debug:
            return True
        return flask.g.user.su is not False


def init_app(app):
    admin.init_app(app)


def configure_admin(app):
    admin.add_view(SecureView(models.ApiKey, db.session))
    admin.add_view(SecureView(models.Cloud, db.session))
    admin.add_view(SecureView(models.User, db.session))
    admin.add_view(SecureView(models.Vendor, db.session))

f20414f3ff53fbdbb42900840907dc737f575fec
<mask token>


class SecureView(sqla.ModelView):

    def is_accessible(self):
        if flask.current_app.debug:
            return True
        return flask.g.user.su is not False


<mask token>

<mask token>


class SecureView(sqla.ModelView):

    def is_accessible(self):
        if flask.current_app.debug:
            return True
        return flask.g.user.su is not False


<mask token>


def configure_admin(app):
    admin.add_view(SecureView(models.ApiKey, db.session))
    admin.add_view(SecureView(models.Cloud, db.session))
    admin.add_view(SecureView(models.User, db.session))
    admin.add_view(SecureView(models.Vendor, db.session))

<mask token>


class SecureView(sqla.ModelView):

    def is_accessible(self):
        if flask.current_app.debug:
            return True
        return flask.g.user.su is not False


def init_app(app):
    admin.init_app(app)


def configure_admin(app):
    admin.add_view(SecureView(models.ApiKey, db.session))
    admin.add_view(SecureView(models.Cloud, db.session))
    admin.add_view(SecureView(models.User, db.session))
    admin.add_view(SecureView(models.Vendor, db.session))

import flask
from flask.ext.admin.contrib import sqla
import models
from refstack.extensions import admin
from refstack.extensions import db


class SecureView(sqla.ModelView):

    def is_accessible(self):
        if flask.current_app.debug:
            return True
        return flask.g.user.su is not False


def init_app(app):
    admin.init_app(app)


def configure_admin(app):
    admin.add_view(SecureView(models.ApiKey, db.session))
    admin.add_view(SecureView(models.Cloud, db.session))
    admin.add_view(SecureView(models.User, db.session))
    admin.add_view(SecureView(models.Vendor, db.session))


import flask
from flask.ext.admin.contrib import sqla

import models

# Global admin object
from refstack.extensions import admin
from refstack.extensions import db


class SecureView(sqla.ModelView):
    def is_accessible(self):
        # let us look at the admin if we're in debug mode
        if flask.current_app.debug:
            return True
        return flask.g.user.su is not False


def init_app(app):
    admin.init_app(app)


def configure_admin(app):
    admin.add_view(SecureView(models.ApiKey, db.session))
    admin.add_view(SecureView(models.Cloud, db.session))
    admin.add_view(SecureView(models.User, db.session))
    admin.add_view(SecureView(models.Vendor, db.session))
