75 lines
4.0 KiB
Python
75 lines
4.0 KiB
Python
|
"""
|
||
|
!!!AUTOGENERATED: DO NOT EDIT!!!
|
||
|
|
||
|
Edit the hooks in webapp/routes/permission_hooks.py instead
|
||
|
"""
|
||
|
|
||
|
from flask import render_template
|
||
|
from flask_security import login_required
|
||
|
|
||
|
from oshipka.webapp import app
|
||
|
from oshipka.webapp.views import ModelView
|
||
|
from webapp.routes.permission_hooks import *
|
||
|
from webapp.models import Permission
|
||
|
|
||
|
|
||
|
permission = ModelView(app, Permission, {'name': 'Permission', 'access': [{'verb': 'all', 'login_required': True}], 'columns': [{'name': 'subject', '_type': 'db.UnicodeText'}, {'name': 'subject_id', 'type': 'int', '_type': 'db.Integer'}, {'name': 'action', '_type': 'db.UnicodeText'}, {'name': 'object', '_type': 'db.UnicodeText'}, {'name': 'object_id', 'type': 'int', '_type': 'db.Integer'}, {'name': 'is_allowed', 'type': 'boolean', '_type': 'LiberalBoolean'}], 'display': {'primary': 'subject', 'secondary': 'action', 'tertiary': 'object'}, '_verbs': {'get': {'per_item': 'True', 'methods': ['GET'], 'is_login_required': True, 'the_roles_required': []}, 'list': {'per_item': 'False', 'methods': ['GET'], 'is_login_required': True, 'the_roles_required': []}, 'table': {'per_item': 'False', 'methods': [
|
||
|
'GET'], 'is_login_required': True, 'the_roles_required': []}, 'search': {'per_item': 'False', 'methods': ['GET'], 'is_login_required': True, 'the_roles_required': []}, 'create': {'per_item': 'False', 'methods': ['GET', 'POST'], 'is_login_required': True, 'the_roles_required': []}, 'update': {'per_item': 'True', 'methods': ['GET', 'POST'], 'is_login_required': True, 'the_roles_required': []}, 'delete': {'per_item': 'True', 'methods': ['GET', 'POST'], 'is_login_required': True, 'the_roles_required': []}}, 'acls': {'get': {'authn': True, 'authz': []}, 'list': {'authn': True, 'authz': []}, 'table': {'authn': True, 'authz': []}, 'search': {'authn': True, 'authz': []}, 'create': {'authn': True, 'authz': []}, 'update': {'authn': True, 'authz': []}, 'delete': {'authn': True, 'authz': []}}})
|
||
|
|
||
|
|
||
|
permission.register_verb(view_context=get_view_context,
|
||
|
verb="get",
|
||
|
methods=['GET'],
|
||
|
per_item=True,
|
||
|
is_login_required=True,
|
||
|
the_roles_required=[],
|
||
|
)
|
||
|
|
||
|
permission.register_verb(view_context=list_view_context,
|
||
|
verb="list",
|
||
|
methods=['GET'],
|
||
|
per_item=False,
|
||
|
is_login_required=True,
|
||
|
the_roles_required=[],
|
||
|
)
|
||
|
|
||
|
permission.register_verb(view_context=table_view_context,
|
||
|
verb="table",
|
||
|
methods=['GET'],
|
||
|
per_item=False,
|
||
|
is_login_required=True,
|
||
|
the_roles_required=[],
|
||
|
)
|
||
|
|
||
|
permission.register_verb(view_context=search_view_context,
|
||
|
verb="search",
|
||
|
methods=['GET'],
|
||
|
per_item=False,
|
||
|
is_login_required=True,
|
||
|
the_roles_required=[],
|
||
|
)
|
||
|
|
||
|
permission.register_verb(view_context=create_view_context,
|
||
|
verb="create",
|
||
|
methods=['GET', 'POST'],
|
||
|
per_item=False,
|
||
|
is_login_required=True,
|
||
|
the_roles_required=[],
|
||
|
)
|
||
|
|
||
|
permission.register_verb(view_context=update_view_context,
|
||
|
verb="update",
|
||
|
methods=['GET', 'POST'],
|
||
|
per_item=True,
|
||
|
is_login_required=True,
|
||
|
the_roles_required=[],
|
||
|
)
|
||
|
|
||
|
permission.register_verb(view_context=delete_view_context,
|
||
|
verb="delete",
|
||
|
methods=['GET', 'POST'],
|
||
|
per_item=True,
|
||
|
is_login_required=True,
|
||
|
the_roles_required=[],
|
||
|
)
|