Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CaosDB Python Integration Tests
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
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
caosdb
Software
CaosDB Python Integration Tests
Commits
27ead26a
Commit
27ead26a
authored
1 year ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Add test for container updates of entity ACLs
parent
31fa2ba1
Branches
Branches containing commit
No related tags found
1 merge request
!77
Revert "WIP: pipeline"
Pipeline
#50470
passed
1 year ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_permissions.py
+28
-0
28 additions, 0 deletions
tests/test_permissions.py
with
28 additions
and
0 deletions
tests/test_permissions.py
+
28
−
0
View file @
27ead26a
...
...
@@ -1353,6 +1353,10 @@ def test_select_query_with_invisible_reference():
def
test_update_acl_with_unique
():
"""
Test that ACL can be updated despite name duplications with
``unique=False``.
"""
rt
=
db
.
RecordType
(
name
=
"
TestType
"
).
insert
()
# Name duplicate
...
...
@@ -1380,3 +1384,27 @@ def test_update_acl_with_unique():
rec
=
db
.
Record
(
id
=
rec1
.
id
).
retrieve
()
assert
rec
.
name
==
rec1
.
name
assert
rec
.
name
==
rec2
.
name
def
test_container_update_unique
():
"""
Test that ACL updates are performed correctly within a Container.
"""
# Both are visible to test at first
rt
=
db
.
RecordType
(
name
=
"
TestType
"
).
insert
()
rec1
=
db
.
Record
(
name
=
"
TestRec
"
).
add_parent
(
rt
).
insert
()
rec2
=
db
.
Record
(
name
=
"
TestRec
"
).
add_parent
(
rt
).
insert
(
unique
=
False
)
switch_to_test_user
()
ents
=
db
.
execute_query
(
"
FIND ENTITY TestType
"
)
assert
len
(
ents
)
==
3
switch_to_admin_user
()
cont
=
db
.
Container
().
extend
([
rt
,
rec1
,
rec2
])
cont
.
retrieve
(
flags
=
{
"
ACL
"
:
None
})
for
ent
in
cont
:
ent
.
deny
(
username
=
test_user
,
priority
=
False
,
permission
=
"
RETRIEVE:*
"
)
cont
.
update
(
unique
=
False
)
switch_to_test_user
()
ents
=
db
.
execute_query
(
"
FIND ENTITY TestType
"
)
assert
len
(
ents
)
==
0
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