shared.py 312 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask.ext.principal import Permission, RoleNeed

db = SQLAlchemy()
login_manager = LoginManager()

admin_permission = Permission(RoleNeed("admin"))
user_permission = Permission(RoleNeed("user"))
roles = ["user", "admin"]
11