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
0
Merge Requests
0
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
Łukasz Nowak
slapos.core
Commits
6e4ec90b
Commit
6e4ec90b
authored
Nov 07, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test up to Software Release Module.
parent
74e54a9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
10 deletions
+96
-10
master/bt5/slapos_erp5/TestTemplateItem/testSlapOSGroupRoleSecurity.py
...apos_erp5/TestTemplateItem/testSlapOSGroupRoleSecurity.py
+95
-9
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 @
6e4ec90b
...
@@ -596,28 +596,114 @@ class TestSoftwareInstallationModule(TestSlapOSGroupRoleSecurityMixin):
...
@@ -596,28 +596,114 @@ class TestSoftwareInstallationModule(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
module
,
'zope'
,
[
'Owner'
])
self
.
assertRoles
(
module
,
'zope'
,
[
'Owner'
])
class
TestSoftwareInstance
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestSoftwareInstance
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test_GroupCompany
(
self
):
raise
NotImplementedError
instance
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
'Software Instance'
)
instance
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
instance
,
[
'G-COMPANY'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
instance
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
instance
,
self
.
user_id
,
[
'Owner'
,
'Assignee'
])
test_OwnerBecomeAssignee
=
test_GroupCompany
def
test_CustomerOfTheInstance
(
self
):
customer_reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
customer
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
customer_reference
)
subscription_reference
=
'TESTHS-%s '
%
self
.
generateNewId
()
subscription
=
self
.
portal
.
hosting_subscription_module
.
newContent
(
portal_type
=
'Hosting Subscription'
,
reference
=
subscription_reference
,
destination_section
=
customer
.
getRelativeUrl
())
instance
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
'Software Instance'
,
specialise
=
subscription
.
getRelativeUrl
())
instance
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
instance
,
[
'G-COMPANY'
,
customer_reference
,
subscription_reference
,
self
.
user_id
],
False
)
self
.
assertRoles
(
instance
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
instance
,
customer_reference
,
[
'Assignee'
])
self
.
assertRoles
(
instance
,
subscription_reference
,
[
'Assignor'
])
self
.
assertRoles
(
instance
,
self
.
user_id
,
[
'Owner'
,
'Assignee'
])
test_InstanceRelatedByHostingSubscription
=
test_CustomerOfTheInstance
def
test_Computer
(
self
):
computer_reference
=
'TESTCOMP-%s'
%
self
.
generateNewId
()
computer
=
self
.
portal
.
computer_module
.
template_computer
\
.
Base_createCloneDocument
(
batch_mode
=
1
)
computer
.
edit
(
reference
=
computer_reference
)
partition
=
computer
.
newContent
(
portal_type
=
'Computer Partition'
)
partition
.
recursiveImmediateReindexObject
()
instance
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
'Software Instance'
,
aggregate
=
partition
.
getRelativeUrl
())
instance
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
instance
,
[
'G-COMPANY'
,
computer_reference
,
self
.
user_id
],
False
)
self
.
assertRoles
(
instance
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
instance
,
computer_reference
,
[
'Assignor'
])
self
.
assertRoles
(
instance
,
self
.
user_id
,
[
'Owner'
,
'Assignee'
])
class
TestSoftwareInstanceModule
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestSoftwareInstanceModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test
(
self
):
raise
NotImplementedError
module
=
self
.
portal
.
software_instance_module
self
.
assertSecurityGroup
(
module
,
[
'G-COMPANY'
,
'R-COMPUTER'
,
'R-INSTANCE'
,
'R-MEMBER'
,
'zope'
],
False
)
self
.
assertRoles
(
module
,
'R-MEMBER'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'G-COMPANY'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'R-COMPUTER'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'R-INSTANCE'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'zope'
,
[
'Owner'
])
class
TestSoftwareProduct
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestSoftwareProduct
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test_GroupCompany
(
self
):
raise
NotImplementedError
product
=
self
.
portal
.
software_product_module
.
newContent
(
portal_type
=
'Software Product'
)
product
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
product
,
[
'G-COMPANY'
,
'R-MEMBER'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
product
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
product
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
product
,
self
.
user_id
,
[
'Owner'
])
test_Member
=
test_GroupCompany
class
TestSoftwareProductModule
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestSoftwareProductModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test
(
self
):
raise
NotImplementedError
module
=
self
.
portal
.
software_product_module
self
.
assertSecurityGroup
(
module
,
[
'G-COMPANY'
,
'R-MEMBER'
,
'zope'
],
False
)
self
.
assertRoles
(
module
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'G-COMPANY'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'zope'
,
[
'Owner'
])
class
TestSoftwareRelease
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestSoftwareRelease
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test_GroupCompany
(
self
):
raise
NotImplementedError
release
=
self
.
portal
.
software_release_module
.
newContent
(
portal_type
=
'Software Release'
)
release
.
updateLocalRolesOnSecurityGroups
()
self
.
assertSecurityGroup
(
release
,
[
'G-COMPANY'
,
'R-MEMBER'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
release
,
'G-COMPANY'
,
[
'Assignor'
])
self
.
assertRoles
(
release
,
'R-MEMBER'
,
[
'Auditor'
])
self
.
assertRoles
(
release
,
self
.
user_id
,
[
'Owner'
])
test_Member
=
test_GroupCompany
class
TestSoftwareReleaseModule
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestSoftwareReleaseModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test
(
self
):
raise
NotImplementedError
module
=
self
.
portal
.
software_release_module
self
.
assertSecurityGroup
(
module
,
[
'G-COMPANY'
,
'R-MEMBER'
,
'zope'
],
False
)
self
.
assertRoles
(
module
,
'R-MEMBER'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'G-COMPANY'
,
[
'Auditor'
,
'Author'
])
self
.
assertRoles
(
module
,
'zope'
,
[
'Owner'
])
class
TestSpreadsheet
(
TestSlapOSGroupRoleSecurityMixin
):
class
TestSpreadsheet
(
TestSlapOSGroupRoleSecurityMixin
):
def
test
(
self
):
def
test
(
self
):
...
...
master/bt5/slapos_erp5/bt/revision
View file @
6e4ec90b
59
60
\ 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