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
17
Merge Requests
17
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
68d4b25e
Commit
68d4b25e
authored
Oct 24, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop ERP5Type_getSecurityCategoryFromAggregateMovementItemByPerson.
Do not use packing list to find related documents.
parent
b3ab32eb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
34 deletions
+41
-34
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Computer%20Partition.xml
...erp5/PortalTypeRolesTemplateItem/Computer%20Partition.xml
+1
-1
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/PartitionType_getSecurityCategoryFromUser.xml
...slapos_core/PartitionType_getSecurityCategoryFromUser.xml
+38
-31
master/bt5/slapos_erp5/bt/revision
master/bt5/slapos_erp5/bt/revision
+1
-1
master/bt5/vifib_erp5/bt/revision
master/bt5/vifib_erp5/bt/revision
+1
-1
No files found.
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Computer%20Partition.xml
View file @
68d4b25e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<role
id=
'Auditor'
>
<role
id=
'Auditor'
>
<property
id=
'title'
>
Customer of the partition
</property>
<property
id=
'title'
>
Customer of the partition
</property>
<property
id=
'condition'
>
python: here.getSlapState() == "busy"
</property>
<property
id=
'condition'
>
python: here.getSlapState() == "busy"
</property>
<property
id=
'base_category_script'
>
ERP5Type_getSecurityCategoryFromAggregateMovementItemByPerson
</property>
<property
id=
'base_category_script'
>
PartitionType_getSecurityCategoryFromUser
</property>
<multi_property
id=
'base_category'
>
destination_section
</multi_property>
<multi_property
id=
'base_category'
>
destination_section
</multi_property>
</role>
</role>
<role
id=
'Auditor'
>
<role
id=
'Auditor'
>
...
...
master/bt5/
vifib_erp5/SkinTemplateItem/portal_skins/vifib_core/ERP5Type_getSecurityCategoryFromAggregateMovementItemByPerson
.xml
→
master/bt5/
slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/PartitionType_getSecurityCategoryFromUser
.xml
View file @
68d4b25e
...
@@ -50,46 +50,53 @@
...
@@ -50,46 +50,53 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string>
"""\n
This script returns a list of dictionaries which represent\n
# XXX For now, this script requires proxy manager\n
the security groups which a person is member of. It extracts\n
the categories from the current content. It is useful in the\n
following cases:\n
\n
\n
# base_category_list : list of category values we need to retrieve\n
- calculate a security group based on a given\n
# user_name : string obtained from getSecurityManager().getUser().getUserName() [NuxUserGroup]\n
category of the current object (ex. group). This\n
# or from getSecurityManager().getUser().getId() [PluggableAuthService with ERP5GroupManager]\n
is used for example in ERP5 DMS to calculate\n
# object : object which we want to assign roles to.\n
document security.\n
# portal_type : portal type of object\n
\n
\n
# must always return a list of dicts\n
- assign local roles to a document based on\n
the person which the object related to through\n
a given base category (ex. destination). This\n
is used for example in ERP5 Project to calculate\n
Task / Task Report security.\n
\n
\n
category_list = []
\n
The parameters are
\n
\n
\n
if obj is None:\n
base_category_list -- list of category values we need to retrieve\n
return []\n
user_name -- string obtained from getSecurityManager().getUser().getId()\n
object -- object which we want to assign roles to\n
portal_type -- portal type of object\n
\n
\n
movement_portal_type = "Sale Packing List Line"\n
NOTE: for now, this script requires proxy manager\n
"""\n
\n
\n
portal = obj.getPortalObject()
\n
category_list = []
\n
\n
\n
security_dict = {}\n
if obj is None:\n
return []\n
\n
\n
parent_url_list = []\n
partition = obj\n
for movement in portal.portal_catalog(\n
for instance in partition.getPortalObject().portal_catalog(\n
portal_type=movement_portal_type,\n
portal_type=["Software Instance", "Slave Instance"],\n
aggregate_uid=obj.getUid(),\n
validation_state="validated",\n
simulation_state=portal.getPortalCurrentInventoryStateList() + portal.getPortalReservedInventoryStateList() + portal.getPortalTransitInventoryStateList(),\n
default_aggregate_uid=partition.getUid()):\n
):\n
if instance is not None:\n
item = movement.getDestinationSectionValue(portal_type="Person")\n
hosting_subscription = instance.getSpecialiseValue(portal_type="Hosting Subscription")\n
if item is not None:\n
if hosting_subscription is not None:\n
parent_url_list.append(item.getRelativeUrl())\n
person = hosting_subscription.getDestinationSectionValue(portal_type="Person")\n
if person is not None:\n
for base_category in base_category_list:\n
category_list.append({base_category: [person.getRelativeUrl()]})\n
\n
\n
if len(parent_url_list) >
0:\n
parent_url_list.sort()\n
category_list.append({"destination_section": parent_url_list})\n
return category_list\n
return category_list\n
</string>
</value>
]]>
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
...
@@ -105,7 +112,7 @@ return category_list\n
...
@@ -105,7 +112,7 @@ return category_list\n
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Type_getSecurityCategoryFromAggregateMovementItemByPerson
</string>
</value>
<value>
<string>
PartitionType_getSecurityCategoryFromUser
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
master/bt5/slapos_erp5/bt/revision
View file @
68d4b25e
11
12
\ No newline at end of file
\ No newline at end of file
master/bt5/vifib_erp5/bt/revision
View file @
68d4b25e
513
514
\ 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