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
Labels
Merge Requests
19
Merge Requests
19
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
ebf34872
Commit
ebf34872
authored
Nov 07, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check that creator is Owner.
parent
b9120af9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSGroupRoleSecurity.py
...apos_erp5/TestTemplateItem/testSlapOSGroupRoleSecurity.py
+18
-0
master/bt5/slapos_erp5/bt/revision
master/bt5/slapos_erp5/bt/revision
+1
-1
No files found.
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSGroupRoleSecurity.py
View file @
ebf34872
...
@@ -57,6 +57,7 @@ class TestComputer(TestSlapOSGroupRoleSecurityMixin):
...
@@ -57,6 +57,7 @@ class TestComputer(TestSlapOSGroupRoleSecurityMixin):
self
.
assertSecurityGroup
(
computer
,
self
.
assertSecurityGroup
(
computer
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
computer
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
computer
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
computer
,
self
.
user_id
,
[
'Owner'
])
def
test_ComputerAgent
(
self
):
def
test_ComputerAgent
(
self
):
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
...
@@ -68,6 +69,7 @@ class TestComputer(TestSlapOSGroupRoleSecurityMixin):
...
@@ -68,6 +69,7 @@ class TestComputer(TestSlapOSGroupRoleSecurityMixin):
self
.
assertSecurityGroup
(
computer
,
self
.
assertSecurityGroup
(
computer
,
[
self
.
user_id
,
'G-COMPANY'
,
reference
],
False
)
[
self
.
user_id
,
'G-COMPANY'
,
reference
],
False
)
self
.
assertRoles
(
computer
,
reference
,
[
'Assignee'
])
self
.
assertRoles
(
computer
,
reference
,
[
'Assignee'
])
self
.
assertRoles
(
computer
,
self
.
user_id
,
[
'Owner'
])
def
test_AllocationScope
(
self
):
def
test_AllocationScope
(
self
):
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
)
computer
=
self
.
portal
.
computer_module
.
newContent
(
portal_type
=
'Computer'
)
...
@@ -78,6 +80,7 @@ class TestComputer(TestSlapOSGroupRoleSecurityMixin):
...
@@ -78,6 +80,7 @@ class TestComputer(TestSlapOSGroupRoleSecurityMixin):
self
.
assertSecurityGroup
(
computer
,
self
.
assertSecurityGroup
(
computer
,
[
self
.
user_id
,
'G-COMPANY'
,
'R-SHADOW-PERSON'
],
False
)
[
self
.
user_id
,
'G-COMPANY'
,
'R-SHADOW-PERSON'
],
False
)
self
.
assertRoles
(
computer
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
self
.
assertRoles
(
computer
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
self
.
assertRoles
(
computer
,
self
.
user_id
,
[
'Owner'
])
# open/personal
# open/personal
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
...
@@ -91,6 +94,7 @@ class TestComputer(TestSlapOSGroupRoleSecurityMixin):
...
@@ -91,6 +94,7 @@ class TestComputer(TestSlapOSGroupRoleSecurityMixin):
self
.
assertSecurityGroup
(
computer
,
self
.
assertSecurityGroup
(
computer
,
[
self
.
user_id
,
'G-COMPANY'
,
shadow_reference
,
reference
],
False
)
[
self
.
user_id
,
'G-COMPANY'
,
shadow_reference
,
reference
],
False
)
self
.
assertRoles
(
computer
,
shadow_reference
,
[
'Auditor'
])
self
.
assertRoles
(
computer
,
shadow_reference
,
[
'Auditor'
])
self
.
assertRoles
(
computer
,
self
.
user_id
,
[
'Owner'
])
# open/friend
# open/friend
friend_reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
friend_reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
...
@@ -104,6 +108,7 @@ class TestComputer(TestSlapOSGroupRoleSecurityMixin):
...
@@ -104,6 +108,7 @@ class TestComputer(TestSlapOSGroupRoleSecurityMixin):
self
.
assertSecurityGroup
(
computer
,
self
.
assertSecurityGroup
(
computer
,
[
self
.
user_id
,
'G-COMPANY'
,
shadow_friend_reference
,
reference
],
False
)
[
self
.
user_id
,
'G-COMPANY'
,
shadow_friend_reference
,
reference
],
False
)
self
.
assertRoles
(
computer
,
shadow_friend_reference
,
[
'Auditor'
])
self
.
assertRoles
(
computer
,
shadow_friend_reference
,
[
'Auditor'
])
self
.
assertRoles
(
computer
,
self
.
user_id
,
[
'Owner'
])
def
test_selfComputer
(
self
):
def
test_selfComputer
(
self
):
reference
=
'TESTCOMP-%s'
%
self
.
generateNewId
()
reference
=
'TESTCOMP-%s'
%
self
.
generateNewId
()
...
@@ -113,6 +118,7 @@ class TestComputer(TestSlapOSGroupRoleSecurityMixin):
...
@@ -113,6 +118,7 @@ class TestComputer(TestSlapOSGroupRoleSecurityMixin):
self
.
assertSecurityGroup
(
computer
,
self
.
assertSecurityGroup
(
computer
,
[
self
.
user_id
,
'G-COMPANY'
,
reference
],
False
)
[
self
.
user_id
,
'G-COMPANY'
,
reference
],
False
)
self
.
assertRoles
(
computer
,
reference
,
[
'Assignor'
])
self
.
assertRoles
(
computer
,
reference
,
[
'Assignor'
])
self
.
assertRoles
(
computer
,
self
.
user_id
,
[
'Owner'
])
class
TestComputerModel
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestComputerModel
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_GroupCompany
(
self
):
def
test_GroupCompany
(
self
):
...
@@ -122,6 +128,7 @@ class TestComputerModel(TestSlapOSGroupRoleSecurityMixin):
...
@@ -122,6 +128,7 @@ class TestComputerModel(TestSlapOSGroupRoleSecurityMixin):
self
.
assertSecurityGroup
(
model
,
self
.
assertSecurityGroup
(
model
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
model
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
model
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
model
,
self
.
user_id
,
[
'Owner'
])
def
test_ComputerAgent
(
self
):
def
test_ComputerAgent
(
self
):
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
...
@@ -134,6 +141,7 @@ class TestComputerModel(TestSlapOSGroupRoleSecurityMixin):
...
@@ -134,6 +141,7 @@ class TestComputerModel(TestSlapOSGroupRoleSecurityMixin):
self
.
assertSecurityGroup
(
model
,
self
.
assertSecurityGroup
(
model
,
[
'G-COMPANY'
,
self
.
user_id
,
reference
],
False
)
[
'G-COMPANY'
,
self
.
user_id
,
reference
],
False
)
self
.
assertRoles
(
model
,
reference
,
[
'Assignee'
])
self
.
assertRoles
(
model
,
reference
,
[
'Assignee'
])
self
.
assertRoles
(
model
,
self
.
user_id
,
[
'Owner'
])
class
TestComputerModelModule
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestComputerModelModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test
(
self
):
...
@@ -162,6 +170,7 @@ class TestComputerNetwork(TestSlapOSGroupRoleSecurityMixin):
...
@@ -162,6 +170,7 @@ class TestComputerNetwork(TestSlapOSGroupRoleSecurityMixin):
[
'G-COMPANY'
,
'R-SHADOW-PERSON'
,
self
.
user_id
],
False
)
[
'G-COMPANY'
,
'R-SHADOW-PERSON'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
network
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
network
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
network
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
self
.
assertRoles
(
network
,
'R-SHADOW-PERSON'
,
[
'Auditor'
])
self
.
assertRoles
(
network
,
self
.
user_id
,
[
'Owner'
])
test_PersonShadow
=
test_GroupCompany
test_PersonShadow
=
test_GroupCompany
...
@@ -176,6 +185,7 @@ class TestComputerNetwork(TestSlapOSGroupRoleSecurityMixin):
...
@@ -176,6 +185,7 @@ class TestComputerNetwork(TestSlapOSGroupRoleSecurityMixin):
self
.
assertSecurityGroup
(
network
,
self
.
assertSecurityGroup
(
network
,
[
'G-COMPANY'
,
'R-SHADOW-PERSON'
,
self
.
user_id
,
reference
],
False
)
[
'G-COMPANY'
,
'R-SHADOW-PERSON'
,
self
.
user_id
,
reference
],
False
)
self
.
assertRoles
(
network
,
reference
,
[
'Assignee'
])
self
.
assertRoles
(
network
,
reference
,
[
'Assignee'
])
self
.
assertRoles
(
network
,
self
.
user_id
,
[
'Owner'
])
class
TestComputerNetworkModule
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestComputerNetworkModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test
(
self
):
...
@@ -231,6 +241,7 @@ class TestComputerPartition(TestSlapOSGroupRoleSecurityMixin):
...
@@ -231,6 +241,7 @@ class TestComputerPartition(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
partition
,
instance_customer_reference
,
[
'Auditor'
])
self
.
assertRoles
(
partition
,
instance_customer_reference
,
[
'Auditor'
])
self
.
assertRoles
(
partition
,
slave_customer_reference
,
[
'Auditor'
])
self
.
assertRoles
(
partition
,
slave_customer_reference
,
[
'Auditor'
])
self
.
assertRoles
(
partition
,
instance_subscription_reference
,
[
'Auditor'
])
self
.
assertRoles
(
partition
,
instance_subscription_reference
,
[
'Auditor'
])
self
.
assertRoles
(
partition
,
self
.
user_id
,
[
'Owner'
])
test_SoftwareInstanceGroupRelatedToComputerPartition
=
\
test_SoftwareInstanceGroupRelatedToComputerPartition
=
\
test_CustomerOfThePartition
test_CustomerOfThePartition
...
@@ -253,6 +264,7 @@ class TestDataSet(TestSlapOSGroupRoleSecurityMixin):
...
@@ -253,6 +264,7 @@ class TestDataSet(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
data_set
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
data_set
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
data_set
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
data_set
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
data_set
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
data_set
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
data_set
,
self
.
user_id
,
[
'Owner'
])
class
TestDataSetModule
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestDataSetModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test
(
self
):
...
@@ -287,6 +299,7 @@ class TestDrawing(TestSlapOSGroupRoleSecurityMixin):
...
@@ -287,6 +299,7 @@ class TestDrawing(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
drawing
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
drawing
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
drawing
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
drawing
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
drawing
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
drawing
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
drawing
,
self
.
user_id
,
[
'Owner'
])
test_GroupCompany
=
test_SecurityForShacache
test_GroupCompany
=
test_SecurityForShacache
...
@@ -302,6 +315,7 @@ class TestFile(TestSlapOSGroupRoleSecurityMixin):
...
@@ -302,6 +315,7 @@ class TestFile(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
file_
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
file_
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
file_
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
file_
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
file_
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
file_
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
file_
,
self
.
user_id
,
[
'Owner'
])
test_GroupCompany
=
test_SecurityForShacache
test_GroupCompany
=
test_SecurityForShacache
...
@@ -314,6 +328,7 @@ class TestHostingSubscription(TestSlapOSGroupRoleSecurityMixin):
...
@@ -314,6 +328,7 @@ class TestHostingSubscription(TestSlapOSGroupRoleSecurityMixin):
self
.
assertSecurityGroup
(
subscription
,
[
self
.
user_id
,
reference
],
False
)
self
.
assertSecurityGroup
(
subscription
,
[
self
.
user_id
,
reference
],
False
)
self
.
assertRoles
(
subscription
,
reference
,
[
'Assignor'
])
self
.
assertRoles
(
subscription
,
reference
,
[
'Assignor'
])
self
.
assertRoles
(
subscription
,
self
.
user_id
,
[
'Owner'
])
def
test_CustomOfTheHostingSubscription
(
self
):
def
test_CustomOfTheHostingSubscription
(
self
):
customer_reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
customer_reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
...
@@ -329,6 +344,7 @@ class TestHostingSubscription(TestSlapOSGroupRoleSecurityMixin):
...
@@ -329,6 +344,7 @@ class TestHostingSubscription(TestSlapOSGroupRoleSecurityMixin):
customer_reference
],
False
)
customer_reference
],
False
)
self
.
assertRoles
(
subscription
,
reference
,
[
'Assignor'
])
self
.
assertRoles
(
subscription
,
reference
,
[
'Assignor'
])
self
.
assertRoles
(
subscription
,
customer_reference
,
[
'Assignee'
])
self
.
assertRoles
(
subscription
,
customer_reference
,
[
'Assignee'
])
self
.
assertRoles
(
subscription
,
self
.
user_id
,
[
'Owner'
])
class
TestHostingSubscriptionModule
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestHostingSubscriptionModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test
(
self
):
...
@@ -352,6 +368,7 @@ class TestImage(TestSlapOSGroupRoleSecurityMixin):
...
@@ -352,6 +368,7 @@ class TestImage(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
image
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
image
,
'R-INSTANCE'
,
[
'Auditor'
])
self
.
assertRoles
(
image
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
image
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
image
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
image
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
image
,
self
.
user_id
,
[
'Owner'
])
test_GroupCompany
=
test_SecurityForShacache
test_GroupCompany
=
test_SecurityForShacache
...
@@ -375,6 +392,7 @@ class TestOrganisation(TestSlapOSGroupRoleSecurityMixin):
...
@@ -375,6 +392,7 @@ class TestOrganisation(TestSlapOSGroupRoleSecurityMixin):
[
'G-COMPANY'
,
self
.
user_id
,
'R-MEMBER'
],
False
)
[
'G-COMPANY'
,
self
.
user_id
,
'R-MEMBER'
],
False
)
self
.
assertRoles
(
organisation
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
organisation
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
organisation
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
organisation
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
organisation
,
self
.
user_id
,
[
'Owner'
])
test_Member
=
test_GroupCompany
test_Member
=
test_GroupCompany
...
...
master/bt5/slapos_erp5/bt/revision
View file @
ebf34872
51
52
\ No newline at end of file
\ No newline at end of file
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