Commit 303a9d42 by aa.gusti

edit permissions

1 parent 3712cdd8
......@@ -470,7 +470,7 @@ def get_route_names(rows):
def get_children(rows):
log.debug(f"Children: {rows}")
# log.debug(f"Children: {rows}")
return [dict(
order_id=r.order_id,
id=r.id,
......@@ -490,7 +490,7 @@ def get_module_menus(module):
Route.parent_id == None)
result = get_children(query.order_by(Route.order_id))
log.debug(result)
# log.debug(result)
return result
......
......@@ -207,11 +207,11 @@ class Views(BaseView):
term = 'term' in params and params['term'] or ''
q = Route.query(). \
filter(Route.status == 1,
Route.nama.ilike('%%%s%%' % term)) \
.order_by(Route.nama)
Route.kode.ilike('%%%s%%' % term)) \
.order_by(Route.kode)
r = []
for k in q.all():
d = dict(id=k.id, value=k.nama, kode=k.kode, nama=k.nama)
d = dict(id=k.id, value=k.kode, kode=k.kode, nama=k.nama)
r.append(d)
return r
......@@ -222,7 +222,7 @@ class Views(BaseView):
values = super().get_values(row, istime, null)
if row.parent_id:
route = Route.query_id(row.parent_id).first()
values["parent_nm"] = route and route.nama or ""
values["parent_nm"] = route and route.kode or ""
_logging.debug(values)
return values
......
......@@ -206,7 +206,8 @@ class ExternalIdentity(ExternalIdentityMixin, CommonModel, Base):
class Permission(Base, CommonModel):
__tablename__ = 'permissions'
__table_args__ = {'extend_existing': True, }
__table_args__ = ({'extend_existing': True, },
TABLE_ARGS)
id = Column(Integer, primary_key=True)
perm_name = Column(String(64), nullable=False, unique=True)
description = Column(String(64), nullable=False, unique=True)
......@@ -237,4 +238,4 @@ def init_model():
ziggurat_model_init(User, Group, UserGroup, GroupPermission, UserPermission,
UserResourcePermission, GroupResourcePermission,
Resource,
ExternalIdentity, passwordmanager=None)
ExternalIdentity, passwordmanager=None)
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!