Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
1c4f6e07
Commit
1c4f6e07
authored
Jan 31, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: fix user security group test
parent
636843ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
18 deletions
+28
-18
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSecurityGroup.py
...rtal_components/test.erp5.testSlapOSCloudSecurityGroup.py
+28
-18
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudSecurityGroup.py
View file @
1c4f6e07
...
...
@@ -230,7 +230,7 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
self
.
login
(
person
.
getUserId
())
user
=
getSecurityManager
().
getUser
()
self
.
assertTrue
(
'Authenticated'
in
user
.
getRoles
())
self
.
assertSameSet
([
'G-COMPANY'
],
user
.
getGroups
())
self
.
assertSameSet
([],
user
.
getGroups
())
# add to role category
self
.
login
()
...
...
@@ -241,14 +241,23 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
self
.
login
(
person
.
getUserId
())
user
=
getSecurityManager
().
getUser
()
self
.
assertTrue
(
'Authenticated'
in
user
.
getRoles
())
self
.
assertSameSet
([
'R-MEMBER'
,
'G-COMPANY'
],
user
.
getGroups
())
self
.
assertSameSet
([],
user
.
getGroups
())
# add to function category
self
.
login
()
person
.
newContent
(
portal_type
=
'Assignment'
,
function
=
'accounting/manager'
).
open
()
self
.
tic
()
self
.
portal
.
portal_caches
.
clearAllCache
()
self
.
login
(
person
.
getUserId
())
user
=
getSecurityManager
().
getUser
()
self
.
assertTrue
(
'Authenticated'
in
user
.
getRoles
())
self
.
assertSameSet
([
'F-ACCMAN'
,
'F-ACCOUNTING*'
,
'F-ACCMAN*'
],
user
.
getGroups
())
# add
to role for
project
# add project
self
.
login
()
project
=
self
.
portal
.
project_module
.
newContent
(
portal_type
=
"Project"
)
project
.
validate
()
project
=
self
.
addProject
()
person
.
newContent
(
portal_type
=
'Assignment'
,
destination_project_value
=
project
).
open
()
self
.
tic
()
...
...
@@ -257,31 +266,32 @@ class TestSlapOSPersonSecurity(TestSlapOSSecurityMixin):
self
.
login
(
person
.
getUserId
())
user
=
getSecurityManager
().
getUser
()
self
.
assertTrue
(
'Authenticated'
in
user
.
getRoles
())
self
.
assertSameSet
([
'R-MEMBER'
,
'G-COMPANY'
,
project
.
getReference
()],
user
.
getGroups
())
self
.
assertSameSet
([
'F-ACCMAN'
,
'F-ACCOUNTING*'
,
'F-ACCMAN*'
,
project
.
getReference
()],
user
.
getGroups
())
# add
to role for project
# add
project and function
self
.
login
()
organisation
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
"Organisation"
,
reference
=
"OTEST-%s"
%
person
.
getUserId
()
)
organisation
.
validate
()
project2
=
self
.
addProject
()
person
.
newContent
(
portal_type
=
'Assignment'
,
destination_
value
=
organisation
).
open
()
destination_
project_value
=
project2
,
function
=
'production/manager'
).
open
()
self
.
tic
()
self
.
portal
.
portal_caches
.
clearAllCache
()
self
.
login
(
person
.
getUserId
())
user
=
getSecurityManager
().
getUser
()
self
.
assertTrue
(
'Authenticated'
in
user
.
getRoles
())
self
.
assertSameSet
([
'R-MEMBER'
,
'G-COMPANY'
,
organisation
.
getReference
(),
project
.
getReference
()],
user
.
getGroups
())
self
.
assertSameSet
([
'F-ACCMAN'
,
'F-ACCOUNTING*'
,
'F-ACCMAN*'
,
project
.
getReference
(),
'F-PRODMAN'
,
'F-PRODUCTION*'
,
'F-PRODMAN*'
,
project2
.
getReference
(),
'%s_F-PRODMAN'
%
project2
.
getReference
()],
user
.
getGroups
())
def
test_inactive
(
self
,
login_portal_type
=
"Certificate Login"
):
reference
=
self
.
_generateRandomUniqueReference
(
'Person'
)
user_id
=
self
.
_generateRandomUniqueReference
(
'Person'
)
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
reference
)
password
=
person
.
Person_generatePassword
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment