blog/webapp/models/_permission.py

20 lines
812 B
Python
Raw Permalink Normal View History

2021-05-15 01:04:17 +02:00
from oshipka.persistance import db, ModelController, index_service, LiberalBoolean, Ownable
class Permission(db.Model, ModelController):
_file_columns = []
model_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': []}}
subject = db.Column(db.UnicodeText,)
subject_id = db.Column(db.Integer,)
action = db.Column(db.UnicodeText,)
object = db.Column(db.UnicodeText,)
object_id = db.Column(db.Integer,)
is_allowed = db.Column(LiberalBoolean,)
def __repr__(self):
return "{} ({} - {})".format(self.subject, self.action, self.object)