Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
netvs-middleware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scc-net
netvs
netvs-middleware
Commits
5b5ce21f
Commit
5b5ce21f
authored
8 months ago
by
!! Julian Keck (old Account; do not use) !!
Browse files
Options
Downloads
Patches
Plain Diff
UPD bump middleware to api 4.1
Closes #730 Closes #729
parent
b63d9f46
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
model/wapi/cntl.py
+12
-11
12 additions, 11 deletions
model/wapi/cntl.py
util/wapi_util.py
+1
-1
1 addition, 1 deletion
util/wapi_util.py
with
13 additions
and
12 deletions
model/wapi/cntl.py
+
12
−
11
View file @
5b5ce21f
...
...
@@ -97,27 +97,28 @@ class Mgr(BaseModel):
return
bcd
in
[
v
.
name
for
v
in
self
.
get_bcds
(
conn
)]
def
get_permissions
(
self
,
conn
):
if
self
.
permission_list
is
not
None
:
return
self
.
permission_list
result
=
execute_wapi_function
(
conn
,
[
{
'
name
'
:
'
cntl.mgr.list
'
,
'
old
'
:
{
'
is_self
'
:
True
}},
{
'
name
'
:
'
cntl.role.list
'
,
'
old
'
:
{
{
'
name
'
:
'
cntl.role.list
'
,
'
idx
'
:
'
direct_role_list
'
,
'
old
'
:
{
'
is_directly_assigned
'
:
True
,
'
is_role
'
:
True
,
}},
{
'
name
'
:
'
cntl.role.list
'
,
'
old
'
:
{
'
is_role
'
:
True
},
'
idx
'
:
'
role_list
'
,
'
inner_join_ref
'
:
{
'
direct_role_list
'
:
'
api_func_cntl_role_hierarchy_gfk_list_is_superset
'
}},
{
'
name
'
:
'
cntl.role.list
'
,
'
old
'
:
{
'
is_role
'
:
False
},
'
idx
'
:
'
permission_list
'
,
'
inner_join_ref
'
:
{
'
role_list
'
:
'
api_func_cntl_role_hierarchy_gfk_list_is_superset
'
}}
],
user
=
self
.
login_name
)
if
'
cntl_role
_list
'
not
in
result
.
keys
()
or
len
(
result
[
'
cntl_role
_list
'
])
==
0
:
if
'
permission
_list
'
not
in
result
.
keys
()
or
len
(
result
[
'
permission
_list
'
])
==
0
:
self
.
permission_list
=
[]
return
self
.
permission_list
perms
=
[]
roles
=
result
[
'
cntl_role_list
'
]
for
role
in
roles
:
for
permission
in
role
[
'
contained_permissions
'
].
keys
():
perms
.
append
(
permission
)
self
.
permission_list
=
perms
self
.
permission_list
=
list
(
map
(
lambda
x
:
x
[
'
fq_name
'
],
result
[
'
permission_list
'
]))
return
self
.
permission_list
def
has_permission
(
self
,
conn
,
permission
:
str
):
...
...
This diff is collapsed.
Click to expand it.
util/wapi_util.py
+
1
−
1
View file @
5b5ce21f
...
...
@@ -30,7 +30,7 @@ def execute_wapi_function(conn, request: list[dict[str, str | dict]], user: str
user
=
settings
.
wapi_netvs_superuser
query
=
"""
select * from wapi_4_
0
.ta_handler(
select * from wapi_4_
1
.ta_handler(
in_login_name => %(login_name)s,
in_http_rq_mthd =>
'
POST
'
,
in_http_rq_body => %(rq)s,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment