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
5a8b805e
Commit
5a8b805e
authored
Nov 03, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: test Access Token local roles
parent
85083ce2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
6 deletions
+31
-6
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Restricted%20Access%20Token.xml
...rtalTypeRolesTemplateItem/Restricted%20Access%20Token.xml
+0
-6
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+31
-0
No files found.
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Restricted%20Access%20Token.xml
View file @
5a8b805e
...
@@ -5,10 +5,4 @@
...
@@ -5,10 +5,4 @@
<multi_property
id=
'categories'
>
local_role_group/user
</multi_property>
<multi_property
id=
'categories'
>
local_role_group/user
</multi_property>
<multi_property
id=
'base_category'
>
agent
</multi_property>
<multi_property
id=
'base_category'
>
agent
</multi_property>
</role>
</role>
<role
id=
'Assignor'
>
<property
id=
'title'
>
Group company
</property>
<multi_property
id=
'categories'
>
local_role_group/group
</multi_property>
<multi_property
id=
'category'
>
group/company
</multi_property>
<multi_property
id=
'base_category'
>
group
</multi_property>
</role>
</type_roles>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
5a8b805e
...
@@ -1948,3 +1948,34 @@ class TestCredentialUpdateModule(TestSlapOSGroupRoleSecurityMixin):
...
@@ -1948,3 +1948,34 @@ class TestCredentialUpdateModule(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
module
,
'F-SALE*'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'F-SALE*'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
module
.
Base_getOwnerId
(),
[
'Owner'
])
self
.
assertRoles
(
module
,
module
.
Base_getOwnerId
(),
[
'Owner'
])
class
TestAccessTokenModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_AccessTokenModule
(
self
):
module
=
self
.
portal
.
access_token_module
self
.
assertSecurityGroup
(
module
,
[
'F-PRODUCTION*'
,
module
.
Base_getOwnerId
()],
False
)
self
.
assertRoles
(
module
,
'F-PRODUCTION*'
,
[
'Author'
])
self
.
assertRoles
(
module
,
module
.
Base_getOwnerId
(),
[
'Owner'
])
class
TestRestrictedAccessToken
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_RestrictedAccessToken_default
(
self
):
delivery
=
self
.
portal
.
access_token_module
.
newContent
(
portal_type
=
'Restricted Access Token'
)
self
.
assertSecurityGroup
(
delivery
,
[
self
.
user_id
],
False
)
self
.
assertRoles
(
delivery
,
self
.
user_id
,
[
'Owner'
])
def
test_RestrictedAccessToken_agent
(
self
):
# There is no interaction workflow to recalculate local roles
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
)
delivery
=
self
.
portal
.
access_token_module
.
newContent
(
agent_value
=
person
,
portal_type
=
'Restricted Access Token'
)
self
.
assertSecurityGroup
(
delivery
,
[
person
.
getUserId
(),
self
.
user_id
],
False
)
self
.
assertRoles
(
delivery
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
delivery
,
person
.
getUserId
(),
[
'Auditor'
])
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