Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5_workflow
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenjie.zheng
erp5_workflow
Commits
ef496230
Commit
ef496230
authored
Oct 13, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Variable.py: getInfoGuard allow to return none if necessary.
parent
432ba65e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
23 deletions
+25
-23
product/ERP5Workflow/Document/Variable.py
product/ERP5Workflow/Document/Variable.py
+25
-23
No files found.
product/ERP5Workflow/Document/Variable.py
View file @
ef496230
...
...
@@ -73,29 +73,31 @@ class Variable(IdAsReferenceMixin("variable_", "prefix"), XMLObject):
else
:
return
self
.
default_expr
.
text
def
generateInfoGuard
(
self
):
if
self
.
info_guard
==
None
:
self
.
info_guard
=
Guard
(
permissions
=
self
.
getPermissionList
(),
roles
=
self
.
getRoleList
(),
groups
=
self
.
getGroupList
(),
expr
=
Expression
(
self
.
getExpression
()))
if
self
.
getRoleList
()
is
not
None
:
self
.
info_guard
.
roles
=
self
.
getRoleList
()
if
self
.
getPermissionList
()
is
not
None
:
self
.
info_guard
.
permissions
=
self
.
getPermissionList
()
if
self
.
getGroupList
()
is
not
None
:
self
.
info_guard
.
groups
=
self
.
getGroupList
()
if
self
.
getExpression
()
is
not
None
:
self
.
info_guard
.
expr
=
Expression
(
self
.
getExpression
())
def
getInfoGuardSummary
(
self
):
res
=
None
if
self
.
getGuard
()
is
not
None
:
res
=
self
.
guard
.
getSummary
()
return
res
def
getInfoGuard
(
self
):
if
self
.
info_guard
is
not
None
:
self
.
generateInfoGuard
()
return
self
.
info_guard
if
self
.
getRoleList
()
is
None
and
\
self
.
getPermissionList
()
is
None
and
\
self
.
getGroupList
()
is
None
and
\
self
.
getExpression
()
is
None
and
\
self
.
guard
is
None
:
return
None
else
:
self
.
generateGuard
()
return
self
.
guard
def
getInfoGuardSummary
(
self
):
res
=
None
if
self
.
info_guard
is
not
None
:
res
=
self
.
info_guard
.
getSummary
()
return
res
\ No newline at end of file
def
generateInfoGuard
(
self
):
if
self
.
guard
is
None
:
self
.
guard
=
Guard
().
__of__
(
self
)
if
self
.
getRoleList
()
is
not
None
:
self
.
guard
.
roles
=
self
.
getRoleList
()
if
self
.
getPermissionList
()
is
not
None
:
self
.
guard
.
permissions
=
self
.
getPermissionList
()
if
self
.
getGroupList
()
is
not
None
:
self
.
guard
.
groups
=
self
.
getGroupList
()
if
self
.
getExpression
()
is
not
None
:
self
.
guard
.
expr
=
Expression
(
self
.
getExpression
())
\ 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