# Path: yapper/blueprints/user/models.py
# class Permission:
#     WRITE_POSTS = 0x01
#     READ_ONLY = 0x02
#     ADMIN = 0xff
#     ANONYMOUS = 0x00
# 
#     @staticmethod
#     def user():
#         return (Permission.WRITE_POSTS, True)
# 
#     @staticmethod
#     def admin():
#         return (Permission.ADMIN, False)


import os
from flask import (
    url_for,
    send_from_directory,
    redirect,
    Blueprint
)
from ..user.models import Permission
from config import basedir



BP_NM = 'main'

main = Blueprint(BP_NM, __name__, template_folder='views')

TEMPLATE_DIR = os.path.join(basedir, 'templates')
STATIC_DIR = os.path.join(TEMPLATE_DIR, 'static')


@main.app_context_processor
def inject_permissions():

# Path: yapper/blueprints/user/models.py
# class Permission:
#     WRITE_POSTS = 0x01
#     READ_ONLY = 0x02
#     ADMIN = 0xff
#     ANONYMOUS = 0x00
# 
#     @staticmethod
#     def user():
#         return (Permission.WRITE_POSTS, True)
# 
#     @staticmethod
#     def admin():
#         return (Permission.ADMIN, False)


# Path: yapper/blueprints/main/controllers.py
import os
from flask import (
    url_for,
    send_from_directory,
    redirect,
    Blueprint
)
from ..user.models import Permission
from config import basedir




BP_NM = 'main'

main = Blueprint(BP_NM, __name__, template_folder='views')

TEMPLATE_DIR = os.path.join(basedir, 'templates')
STATIC_DIR = os.path.join(TEMPLATE_DIR, 'static')


@main.app_context_processor
def inject_permissions():

    return dict(Permission=Permission)