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
iv
erp5
Commits
84a5644f
Commit
84a5644f
authored
Aug 24, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: fix typo (forgotten 'not') + add isGuarded method
parent
8a136576
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
product/ERP5Workflow/Document/Workflow.py
product/ERP5Workflow/Document/Workflow.py
+5
-6
product/ERP5Workflow/mixin/guardable.py
product/ERP5Workflow/mixin/guardable.py
+4
-0
No files found.
product/ERP5Workflow/Document/Workflow.py
View file @
84a5644f
...
...
@@ -350,10 +350,7 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
workflow_title
=
self
.
getTitle
()
for
worklist_value
in
self
.
getWorklistValueList
():
action_box_name
=
worklist_value
.
getActionName
()
is_guarded
=
(
worklist_value
.
getGuardRoleList
()
or
worklist_value
.
getGuardGroupList
()
or
worklist_value
.
getGuardPermissionList
()
or
worklist_value
.
getGuardExpression
().
text
)
is_guarded
=
worklist_value
.
isGuarded
()
guard_role_list
=
worklist_value
.
getGuardRoleList
()
if
action_box_name
:
variable_match
=
{}
...
...
@@ -380,9 +377,11 @@ class Workflow(IdAsReferenceMixin("", "prefix"), XMLObject):
continue
is_permitted_worklist
=
0
if
is_guarded
:
if
not
is_guarded
:
is_permitted_worklist
=
1
elif
(
not
check_guard
or
worklist_value
.
checkGuard
(
security_manager
,
self
,
portal
,
check_roles
=
False
)):
elif
not
check_guard
or
worklist_value
.
checkGuard
(
security_manager
,
self
,
portal
,
check_roles
=
False
):
is_permitted_worklist
=
1
variable_match
[
SECURITY_PARAMETER_ID
]
=
guard_role_list
...
...
product/ERP5Workflow/mixin/guardable.py
View file @
84a5644f
...
...
@@ -30,6 +30,10 @@ class GuardableMixin(object):
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
ManagePortal
)
def
isGuarded
(
self
):
return
self
.
guard_expression
and
self
.
guard_group
and
\
self
.
guard_permission
and
guard_role
def
checkGuard
(
self
,
security_manager
,
workflow
,
current_object
,
check_roles
=
True
,
**
kw
):
"""Checks conditions in this guard.
"""
...
...
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