Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 303a9d42
authored
Nov 19, 2024
by
aa.gusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
edit permissions
1 parent
3712cdd8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
opensipkd/base/__init__.py
opensipkd/base/views/routes.py
opensipkd/models/users.py
opensipkd/base/__init__.py
View file @
303a9d4
...
...
@@ -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
...
...
opensipkd/base/views/routes.py
View file @
303a9d4
...
...
@@ -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
...
...
opensipkd/models/users.py
View file @
303a9d4
...
...
@@ -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
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment