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
9df28209
Commit
9df28209
authored
Jan 12, 2023
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: fixup Account security
parent
50d8d6d6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
11 deletions
+18
-11
master/bt5/slapos_erp5/LocalRolesTemplateItem/account_module.xml
...bt5/slapos_erp5/LocalRolesTemplateItem/account_module.xml
+3
-3
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Account%20Module.xml
...pos_erp5/PortalTypeRolesTemplateItem/Account%20Module.xml
+1
-1
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Account.xml
...r/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Account.xml
+8
-2
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+6
-5
No files found.
master/bt5/slapos_erp5/LocalRolesTemplateItem/account_module.xml
View file @
9df28209
<local_roles_item>
<local_roles>
<role
id=
'F-ACCOUNTING'
>
<role
id=
'F-ACCOUNTING
*
'
>
<item>
Auditor
</item>
<item>
Author
</item>
</role>
...
...
@@ -10,8 +10,8 @@
</local_roles>
<local_role_group_ids>
<local_role_group_id
id=
'function'
>
<principal
id=
'F-ACCOUNTING'
>
Auditor
</principal>
<principal
id=
'F-ACCOUNTING'
>
Author
</principal>
<principal
id=
'F-ACCOUNTING
*
'
>
Auditor
</principal>
<principal
id=
'F-ACCOUNTING
*
'
>
Author
</principal>
</local_role_group_id>
<local_role_group_id
id=
'shadow'
>
<principal
id=
'R-SHADOW-PERSON'
>
Auditor
</principal>
...
...
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Account%20Module.xml
View file @
9df28209
...
...
@@ -3,7 +3,7 @@
<property
id=
'title'
>
Accountant
</property>
<property
id=
'description'
>
Any accountant or accountant manager may create accounts and access accounts
</property>
<multi_property
id=
'categories'
>
local_role_group/function
</multi_property>
<multi_property
id=
'category'
>
function/accounting
</multi_property>
<multi_property
id=
'category'
>
function/accounting
*
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
<role
id=
'Auditor'
>
...
...
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Account.xml
View file @
9df28209
<type_roles>
<role
id=
'Assignee'
>
<property
id=
'title'
>
Accountant Agent
</property>
<multi_property
id=
'categories'
>
local_role_group/function
</multi_property>
<multi_property
id=
'category'
>
function/accounting/agent
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
<role
id=
'Assignor'
>
<property
id=
'title'
>
Accountant
</property>
<property
id=
'title'
>
Accountant
Manager
</property>
<property
id=
'description'
>
Only the accountant can validate new accounts.
</property>
<multi_property
id=
'categories'
>
local_role_group/function
</multi_property>
<multi_property
id=
'category'
>
function/accounting
</multi_property>
<multi_property
id=
'category'
>
function/accounting
/manager
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
<role
id=
'Auditor'
>
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
9df28209
...
...
@@ -1440,19 +1440,20 @@ class TestAccountModule(TestSlapOSGroupRoleSecurityMixin):
module
=
self
.
portal
.
account_module
self
.
changeOwnership
(
module
)
self
.
assertSecurityGroup
(
module
,
[
'
G-COMPANY
'
,
self
.
user_id
,
'R-SHADOW-PERSON'
],
False
)
self
.
assertRoles
(
module
,
'
G-COMPANY
'
,
[
'Auditor'
,
'Author'
])
[
'
F-ACCOUNTING*
'
,
self
.
user_id
,
'R-SHADOW-PERSON'
],
False
)
self
.
assertRoles
(
module
,
'
F-ACCOUNTING*
'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
self
.
user_id
,
[
'Owner'
])
class
TestAccount
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_
GroupCompany
(
self
):
def
test_
AccountingFunction
(
self
):
product
=
self
.
portal
.
account_module
.
newContent
(
portal_type
=
'Account'
)
product
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
product
,
[
'G-COMPANY'
,
self
.
user_id
,
'R-SHADOW-PERSON'
],
False
)
self
.
assertRoles
(
product
,
'G-COMPANY'
,
[
'Assignor'
])
[
'F-ACCMAN'
,
'F-ACCAGT'
,
self
.
user_id
,
'R-SHADOW-PERSON'
],
False
)
self
.
assertRoles
(
product
,
'F-ACCMAN'
,
[
'Assignor'
])
self
.
assertRoles
(
product
,
'F-ACCAGT'
,
[
'Assignee'
])
self
.
assertRoles
(
product
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
self
.
assertRoles
(
product
,
self
.
user_id
,
[
'Owner'
])
...
...
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