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
86b00be0
Commit
86b00be0
authored
Oct 05, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Workflow: remove useless guard methods
parent
ab447bd0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
72 deletions
+0
-72
product/ERP5Workflow/Document/WorkflowVariable.py
product/ERP5Workflow/Document/WorkflowVariable.py
+0
-6
product/ERP5Workflow/mixin/guardable.py
product/ERP5Workflow/mixin/guardable.py
+0
-66
No files found.
product/ERP5Workflow/Document/WorkflowVariable.py
View file @
86b00be0
...
...
@@ -65,12 +65,6 @@ class WorkflowVariable(IdAsReferenceMixin("variable_", "prefix"), XMLObject):
PropertySheet
.
WorkflowVariable
,
)
def
getInfoGuardSummary
(
self
):
res
=
None
if
self
.
getGuard
()
is
not
None
:
res
=
self
.
info_guard
.
getSummary
()
return
res
def
getInfoGuard
(
self
):
if
self
.
getGuardRoleList
()
is
None
and
\
self
.
getGuardPermissionList
()
is
None
and
\
...
...
product/ERP5Workflow/mixin/guardable.py
View file @
86b00be0
...
...
@@ -97,64 +97,6 @@ class GuardableMixin(object):
return
False
return
True
security
.
declareProtected
(
ManagePortal
,
'getSummary'
)
def
getSummary
(
self
):
# Perhaps ought to be in DTML.
summary
=
[]
if
self
.
guard_permission
:
summary
.
append
(
'Requires permission:'
)
summary
.
append
(
formatNameUnion
(
self
.
guard_permission
))
if
self
.
guard_role
:
if
summary
:
summary
.
append
(
'<br/>'
)
summary
.
append
(
'Requires role:'
)
summary
.
append
(
formatNameUnion
(
self
.
guard_role
))
if
self
.
guard_group
:
if
summary
:
summary
.
append
(
'<br/>'
)
summary
.
append
(
'Requires group:'
)
summary
.
append
(
formatNameUnion
(
self
.
guard_group
))
if
self
.
guard_expression
is
not
None
:
if
summary
:
summary
.
append
(
'<br/>'
)
summary
.
append
(
'Requires expr:'
)
summary
.
append
(
'<code>'
+
escape
(
self
.
guard_expression
.
text
)
+
'</code>'
)
return
' '
.
join
(
summary
)
def
changeFromProperties
(
self
,
props
):
'''
Returns True if changes were specified.
'''
if
props
is
None
:
return
False
changed
=
False
given_property
=
props
.
get
(
'guard_permission'
,
None
)
if
given_property
:
changed
=
True
permission_list
=
[
permission
.
strip
()
for
permission
in
given_property
.
split
(
';'
)]
self
.
guard_permission
=
tuple
(
permission_list
)
given_property
=
props
.
get
(
'guard_role'
,
None
)
if
given_property
:
changed
=
True
role_list
=
[
role
.
strip
()
for
role
in
given_property
.
split
(
';'
)]
self
.
guard_role
=
tuple
(
role_list
)
given_property
=
props
.
get
(
'guard_group'
,
None
)
if
given_property
:
changed
=
True
group_list
=
[
group
.
strip
()
for
group
in
given_property
.
split
(
';'
)
]
self
.
guard_group
=
tuple
(
group_list
)
given_property
=
props
.
get
(
'guard_expression'
,
None
)
if
given_property
:
changed
=
True
self
.
guard_expression
=
Expression
(
given_property
)
return
changed
def
_setGuardExpression
(
self
,
text
):
if
text
:
self
.
guard_expression
=
Expression
(
text
)
...
...
@@ -165,11 +107,3 @@ class GuardableMixin(object):
if
self
.
guard_expression
is
None
:
return
Expression
(
''
)
return
self
.
guard_expression
def
formatNameUnion
(
names
):
escaped
=
[
'<code>'
+
escape
(
name
)
+
'</code>'
for
name
in
names
]
if
len
(
escaped
)
==
2
:
return
' or '
.
join
(
escaped
)
elif
len
(
escaped
)
>
2
:
escaped
[
-
1
]
=
' or '
+
escaped
[
-
1
]
return
'; '
.
join
(
escaped
)
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