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
498c2ed6
Commit
498c2ed6
authored
Feb 10, 2017
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: add security declarations
parent
e456d60d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
product/ERP5Workflow/Document/InteractionWorkflow.py
product/ERP5Workflow/Document/InteractionWorkflow.py
+11
-2
product/ERP5Workflow/Document/PermissionRoles.py
product/ERP5Workflow/Document/PermissionRoles.py
+1
-0
No files found.
product/ERP5Workflow/Document/InteractionWorkflow.py
View file @
498c2ed6
...
@@ -84,11 +84,12 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
...
@@ -84,11 +84,12 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
PropertySheet
.
Reference
,
PropertySheet
.
Reference
,
)
)
security
.
declarePrivate
(
'notifyCreated'
)
def
notifyCreated
(
self
,
document
):
def
notifyCreated
(
self
,
document
):
pass
pass
security
.
declareProtected
(
Permissions
.
View
,
'getChainedPortalTypeList'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getChainedPortalTypeList'
)
def
getChainedPortalTypeList
(
self
):
def
getChainedPortalTypeList
(
self
):
"""Returns the list of portal types that are chained to this
"""Returns the list of portal types that are chained to this
interaction workflow."""
interaction workflow."""
...
@@ -246,6 +247,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
...
@@ -246,6 +247,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
script
(
sci
)
# May throw an exception.
script
(
sci
)
# May throw an exception.
return
filtered_transition_list
return
filtered_transition_list
security
.
declarePrivate
(
'notifySuccess'
)
def
notifySuccess
(
self
,
ob
,
transition_list
,
result
,
args
=
None
,
kw
=
None
):
def
notifySuccess
(
self
,
ob
,
transition_list
,
result
,
args
=
None
,
kw
=
None
):
"""
"""
Notifies this workflow that an action has taken place.
Notifies this workflow that an action has taken place.
...
@@ -344,6 +346,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
...
@@ -344,6 +346,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
finally
:
finally
:
setSecurityManager
(
current_security_manager
)
setSecurityManager
(
current_security_manager
)
security
.
declarePrivate
(
'activeScript'
)
def
activeScript
(
self
,
script_name
,
ob_url
,
former_status
,
tdef_id
,
def
activeScript
(
self
,
script_name
,
ob_url
,
former_status
,
tdef_id
,
script_context
=
None
):
script_context
=
None
):
script_context
=
self
.
_asScriptContext
()
script_context
=
self
.
_asScriptContext
()
...
@@ -354,6 +357,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
...
@@ -354,6 +357,7 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
ob
,
self
,
former_status
,
tdef
,
None
,
None
,
None
)
ob
,
self
,
former_status
,
tdef
,
None
,
None
,
None
)
script
(
sci
)
script
(
sci
)
security
.
declarePrivate
(
'isActionSupported'
)
def
isActionSupported
(
self
,
document
,
action
,
**
kw
):
def
isActionSupported
(
self
,
document
,
action
,
**
kw
):
'''
'''
Returns a true value if the given action name
Returns a true value if the given action name
...
@@ -371,12 +375,17 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
...
@@ -371,12 +375,17 @@ class InteractionWorkflow(IdAsReferenceMixin("", "prefix"), Workflow):
return
1
return
1
return
0
return
0
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getStateValueById'
)
def
getStateValueById
(
self
,
reference
):
def
getStateValueById
(
self
,
reference
):
return
None
return
None
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getStateValueList'
)
def
getStateValueList
(
self
):
def
getStateValueList
(
self
):
return
[]
return
[]
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'showAsXML'
)
def
showAsXML
(
self
,
root
=
None
):
def
showAsXML
(
self
,
root
=
None
):
if
root
is
None
:
if
root
is
None
:
root
=
Element
(
'erp5'
)
root
=
Element
(
'erp5'
)
...
...
product/ERP5Workflow/Document/PermissionRoles.py
View file @
498c2ed6
...
@@ -60,6 +60,7 @@ class PermissionRoles(XMLObject):
...
@@ -60,6 +60,7 @@ class PermissionRoles(XMLObject):
PropertySheet
.
DublinCore
,
PropertySheet
.
DublinCore
,
PropertySheet
.
State
,)
PropertySheet
.
State
,)
security
.
declarePrivate
(
'getPermissionRole'
)
def
getPermissionRole
(
self
):
def
getPermissionRole
(
self
):
permission
=
'None'
permission
=
'None'
role
=
'None'
role
=
'None'
...
...
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