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
6505d304
Commit
6505d304
authored
3 years ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
AUDIT: Review test_state.py::test_missing_retrieve_permission
parent
d5e7709e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!31
Tests for caosdb-server#223
Pipeline
#20707
passed
3 years ago
Stage: info
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_state.py
+27
-2
27 additions, 2 deletions
tests/test_state.py
with
27 additions
and
2 deletions
tests/test_state.py
+
27
−
2
View file @
6505d304
# encoding: utf-8
#
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2020-2022 IndiScale GmbH <info@indiscale.com>
# Copyright (C) 2020-2022 Timm Fitschen <t.fitschen@indiscale.com>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# ** end header
#
import
pytest
import
caosdb
as
db
from
caosdb
import
administration
as
admin
...
...
@@ -489,8 +511,10 @@ def test_transfer_state_acl():
state_acl
=
state_acl
.
combine
(
db
.
get_global_acl
())
# the acl has been transfered from the state record
assert
insert_rec
.
acl
.
get_permissions_for_role
(
"
role1
"
)
==
{
"
UPDATE:DESCRIPTION
"
}
assert
"
RETRIEVE:ENTITY
"
not
in
insert_rec
.
acl
.
get_permissions_for_role
(
"
anonymous
"
)
assert
insert_rec
.
acl
.
get_permissions_for_role
(
"
role1
"
)
==
{
"
UPDATE:DESCRIPTION
"
}
assert
"
RETRIEVE:ENTITY
"
not
in
insert_rec
.
acl
.
get_permissions_for_role
(
"
anonymous
"
)
assert
insert_rec
.
acl
==
state_acl
...
...
@@ -817,6 +841,7 @@ def test_transitions_included_after_empty_update():
def
test_missing_retrieve_permission
():
"""
When the retrieve permission is missing, the state must not be leaked.
"""
# @review Florian Spreckelsen 2022-03-22
rec
=
db
.
Record
()
rec
.
description
=
"
old description
"
rec
.
add_parent
(
"
TestRT
"
)
...
...
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