Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sebastien Robin
erp5
Commits
b9040c09
Commit
b9040c09
authored
Feb 10, 2017
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: PermissionRoles is not needed any more
parent
5418abcc
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
288 deletions
+0
-288
product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/PermissionRoles/view.xml
.../ActionTemplateItem/portal_types/PermissionRoles/view.xml
+0
-85
product/ERP5/bootstrap/erp5_core/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
...eAllowedContentTypeTemplateItem/allowed_content_types.xml
+0
-3
product/ERP5/bootstrap/erp5_core/PortalTypeTemplateItem/portal_types/PermissionRoles.xml
...e/PortalTypeTemplateItem/portal_types/PermissionRoles.xml
+0
-68
product/ERP5/bootstrap/erp5_core/bt/template_action_path_list
...uct/ERP5/bootstrap/erp5_core/bt/template_action_path_list
+0
-1
product/ERP5/bootstrap/erp5_core/bt/template_portal_type_allowed_content_type_list
...p5_core/bt/template_portal_type_allowed_content_type_list
+0
-1
product/ERP5/bootstrap/erp5_core/bt/template_portal_type_id_list
.../ERP5/bootstrap/erp5_core/bt/template_portal_type_id_list
+0
-1
product/ERP5Workflow/Document/PermissionRoles.py
product/ERP5Workflow/Document/PermissionRoles.py
+0
-129
No files found.
product/ERP5/bootstrap/erp5_core/ActionTemplateItem/portal_types/PermissionRoles/view.xml
deleted
100644 → 0
View file @
5418abcc
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_view
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_view
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
view
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Action Information
</string>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
1.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
View
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/Permission_view
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml
View file @
b9040c09
...
...
@@ -111,9 +111,6 @@
<portal_type
id=
"Simulation Tool"
>
<item>
Applied Rule
</item>
</portal_type>
<portal_type
id=
"State"
>
<item>
PermissionRoles
</item>
</portal_type>
<portal_type
id=
"Template Tool"
>
<item>
Business Template
</item>
</portal_type>
...
...
product/ERP5/bootstrap/erp5_core/PortalTypeTemplateItem/portal_types/PermissionRoles.xml
deleted
100644 → 0
View file @
5418abcc
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Base Type"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
content_icon
</string>
</key>
<value>
<string>
document.gif
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
An ERP5 permission roles bonder.
</string>
</value>
</item>
<item>
<key>
<string>
erp5workflow_list
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
PermissionRoles
</string>
</value>
</item>
<item>
<key>
<string>
init_script
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
permission
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Base Type
</string>
</value>
</item>
<item>
<key>
<string>
type_class
</string>
</key>
<value>
<string>
PermissionRoles
</string>
</value>
</item>
<item>
<key>
<string>
type_interface
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
type_mixin
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
workflow_list
</string>
</key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_core/bt/template_action_path_list
View file @
b9040c09
...
...
@@ -84,7 +84,6 @@ Interaction Workflow | view
Interaction | view
Memcached Plugin | view
Memcached Tool | view
PermissionRoles | view
Predicate | view
Preference Tool Type | jump_property_sheets
Preference Tool Type | view
...
...
product/ERP5/bootstrap/erp5_core/bt/template_portal_type_allowed_content_type_list
View file @
b9040c09
...
...
@@ -58,7 +58,6 @@ Property Sheet | String Attribute Match Constraint
Property Sheet | TALES Constraint
Simulation Movement | Applied Rule
Simulation Tool | Applied Rule
State | PermissionRoles
Template Tool | Business Template
Transition | Transition Variable
Trash Tool | Trash Bin
...
...
product/ERP5/bootstrap/erp5_core/bt/template_portal_type_id_list
View file @
b9040c09
...
...
@@ -53,7 +53,6 @@ Movement
Notification Tool
Order Tool
Password Tool
PermissionRoles
Predicate
Preference
Preference Tool
...
...
product/ERP5Workflow/Document/PermissionRoles.py
deleted
100644 → 0
View file @
5418abcc
##############################################################################
#
# Copyright (c) 2015 Nexedi SARL and Contributors. All Rights Reserved.
# Wenjie ZHENG <wenjie.zheng@tiolive.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
AccessControl
import
ClassSecurityInfo
from
Acquisition
import
aq_inner
,
aq_parent
from
Products.ERP5Type.Accessor.Constant
import
PropertyGetter
as
ConstantGetter
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
Products.ERP5Type.XMLObject
import
XMLObject
from
zLOG
import
LOG
,
ERROR
,
DEBUG
,
WARNING
class
PermissionRoles
(
XMLObject
):
"""
Permission role matrix cell unit,
Used to assign a role to a permission.
"""
meta_type
=
'ERP5 PermissionRoles'
portal_type
=
'PermissionRoles'
add_permission
=
Permissions
.
AddPortalContent
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
selected
=
0
# checkerbox
isPortalContent
=
1
isRADContent
=
1
# Declarative security
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
# Declarative properties
property_sheets
=
(
PropertySheet
.
Base
,
PropertySheet
.
XMLObject
,
PropertySheet
.
CategoryCore
,
PropertySheet
.
DublinCore
,
PropertySheet
.
State
,)
security
.
declarePrivate
(
'getPermissionRole'
)
def
getPermissionRole
(
self
):
permission
=
'None'
role
=
'None'
if
self
.
selected
==
1
:
permission_id
=
int
(
self
.
id
.
split
(
'_'
)[
1
])
role_id
=
int
(
self
.
id
.
split
(
'_'
)[
2
])
# zwj: make sure here gets the right coordinates
workflow
=
self
.
getParentValue
().
getParentValue
()
permission_list
=
sorted
(
workflow
.
getWorkflowManagedPermissionList
())
role_list
=
workflow
.
getManagedRoleList
()
permission
=
permission_list
[
permission_id
]
role
=
role_list
[
role_id
]
# zwj: check the name of the role and permission is the one we want
if
role
==
'None'
:
role
=
[
'Manager'
]
return
permission
,
role
def
_getPermissionIndex
(
self
):
return
int
(
self
.
id
[
len
(
self
.
base_id
+
'_'
):].
split
(
'_'
)[
0
])
def
_getRoleIndex
(
self
):
return
int
(
self
.
id
[
len
(
self
.
base_id
+
'_'
):].
split
(
'_'
)[
1
])
def
_getPermissionOrRole
(
self
,
is_role
=
False
):
# we want to get the permission or role from its index,
# so we want the retrieve the key of the dict which is like:
# self.index[cell_prefix][index] = {'Some Role Or Permission': 1,
# 'Some Other One': 0, ...}
if
is_role
:
cell_permission_or_role_index
=
self
.
_getRoleIndex
()
else
:
cell_permission_or_role_index
=
self
.
_getPermissionIndex
()
index
=
int
(
is_role
)
for
key
,
value
in
self
.
index
[
self
.
base_id
][
index
].
items
():
if
cell_permission_or_role_index
==
value
:
return
key
raise
ValueError
(
'No key found for value %s.'
%
value
)
def
_getPermission
(
self
):
return
self
.
_getPermissionOrRole
(
is_role
=
False
)
def
_getRole
(
self
):
return
self
.
_getPermissionOrRole
(
is_role
=
True
)
def
_setSelected
(
self
,
value
):
"""
edit the parent state's permission/role dict to reflect current cell selection (selected) status
"""
state
=
self
.
getParentValue
()
cell_range
=
state
.
getCellRange
()
cell_permission
=
self
.
_getPermission
()
cell_role
=
self
.
_getRole
()
# update the state permission structure to take into account
# the selection/non-selection of this cell
roles
=
state
.
getStatePermissionRolesDict
()[
cell_permission
]
acquired
=
isinstance
(
roles
,
tuple
)
roles
=
list
(
set
(
roles
))
if
value
and
(
cell_role
not
in
roles
):
roles
.
append
(
cell_role
)
state
.
setPermission
(
cell_permission
,
acquired
,
roles
)
if
(
not
value
)
and
(
cell_role
in
roles
):
roles
.
remove
(
cell_role
)
state
.
setPermission
(
cell_permission
,
acquired
,
roles
)
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