Initial commit: enterprise digital platform with portal SSO, DigiServer, IT Assets, NetworkView, Server Monitor
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
from flask import Blueprint, render_template, redirect, url_for, current_app
|
||||
from flask_login import login_required, current_user
|
||||
|
||||
bp = Blueprint('dashboard', __name__)
|
||||
|
||||
|
||||
@bp.route('/')
|
||||
@login_required
|
||||
def index():
|
||||
user_apps = set(current_user.get_accessible_apps())
|
||||
apps = []
|
||||
for app_def in current_app.config['REGISTERED_APPS']:
|
||||
apps.append({**app_def, 'has_access': app_def['id'] in user_apps})
|
||||
return render_template('dashboard/index.html', apps=apps)
|
||||
|
||||
|
||||
@bp.route('/access-denied')
|
||||
@login_required
|
||||
def access_denied():
|
||||
return render_template('dashboard/access_denied.html'), 403
|
||||
|
||||
|
||||
@bp.route('/health')
|
||||
def health():
|
||||
return {'status': 'ok'}, 200
|
||||
Reference in New Issue
Block a user