Jun 27 MT-6
This commit is contained in:
@@ -8,6 +8,8 @@ from app.utils.forms import FacilityForm, AreaForm
|
||||
from app.utils.decorators import supervisor_required, admin_required
|
||||
from app.utils.audit import log_action, ACTION_CREATE, ACTION_UPDATE, ACTION_DELETE
|
||||
from app.utils.scope import get_customer_scope, get_inspector_scope
|
||||
from app.tenancy.gates import quota_soft_check
|
||||
from app.tenancy.gates import feature_required
|
||||
|
||||
bp = Blueprint('facilities', __name__, url_prefix='/facilities')
|
||||
|
||||
@@ -15,6 +17,8 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
@bp.route('/')
|
||||
@login_required
|
||||
@supervisor_required
|
||||
@feature_required('scheduled_reports')
|
||||
def list_facilities():
|
||||
if current_user.role == 'customer':
|
||||
cids = get_customer_scope(current_user) or []
|
||||
@@ -54,6 +58,7 @@ def list_facilities():
|
||||
@bp.route('/new', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
@supervisor_required
|
||||
@quota_soft_check('facilities')
|
||||
def create_facility():
|
||||
form = FacilityForm()
|
||||
projects = Project.query.filter_by(active=True).order_by(Project.name).all()
|
||||
|
||||
Reference in New Issue
Block a user