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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joshua
erp5
Commits
cbd66c77
Commit
cbd66c77
authored
Mar 27, 2015
by
wenjie.zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interaction.py: add more functions.
parent
e0da33f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
1 deletion
+63
-1
product/ERP5Workflow/Document/Interaction.py
product/ERP5Workflow/Document/Interaction.py
+63
-1
No files found.
product/ERP5Workflow/Document/Interaction.py
View file @
cbd66c77
...
@@ -53,6 +53,17 @@ class Interaction(XMLObject):
...
@@ -53,6 +53,17 @@ class Interaction(XMLObject):
managed_role
=
()
managed_role
=
()
erp5_permission_roles
=
{}
# { permission: [role] or (role,) }
erp5_permission_roles
=
{}
# { permission: [role] or (role,) }
manager_bypass
=
0
manager_bypass
=
0
trigger_type
=
TRIGGER_WORKFLOW_METHOD
script_name
=
()
# Executed before transition
after_script_name
=
()
# Executed after transition
before_commit_script_name
=
()
#Executed Before Commit Transaction
activate_script_name
=
()
# Executed as activity
portal_type_filter
=
None
portal_type_group_filter
=
None
once_per_transaction
=
False
temporary_document_disallowed
=
False
var_exprs
=
None
# A mapping.
# Declarative security
# Declarative security
security
=
ClassSecurityInfo
()
security
=
ClassSecurityInfo
()
...
@@ -65,4 +76,55 @@ class Interaction(XMLObject):
...
@@ -65,4 +76,55 @@ class Interaction(XMLObject):
PropertySheet
.
CategoryCore
,
PropertySheet
.
CategoryCore
,
PropertySheet
.
DublinCore
,
PropertySheet
.
DublinCore
,
PropertySheet
.
Interaction
,
PropertySheet
.
Interaction
,
)
)
\ No newline at end of file
def
getGuardSummary
(
self
):
res
=
None
if
self
.
guard
is
not
None
:
res
=
self
.
guard
.
getSummary
()
return
res
def
getGuard
(
self
):
if
self
.
guard
is
None
:
self
.
generateGuard
()
return
self
.
guard
def
getVarExprText
(
self
,
id
):
if
not
self
.
var_exprs
:
return
''
else
:
expr
=
self
.
var_exprs
.
get
(
id
,
None
)
if
expr
is
not
None
:
return
expr
.
text
else
:
return
''
def
generateGuard
(
self
):
if
self
.
trigger_type
==
TRIGGER_USER_ACTION
:
if
self
.
guard
==
None
:
self
.
guard
=
Guard
(
permissions
=
self
.
getPermissionList
(),
roles
=
self
.
getRoleList
(),
groups
=
self
.
getGroupList
(),
expr
=
self
.
getExpression
())
if
self
.
guard
.
roles
!=
self
.
getRoleList
():
self
.
guard
.
roles
=
self
.
getRoleList
()
elif
self
.
guard
.
permissions
!=
self
.
getPermissionList
():
self
.
guard
.
permissions
=
self
.
getPermissionList
()
elif
self
.
guard
.
groups
!=
self
.
getGroupList
():
self
.
guard
.
groups
=
self
.
getGroupList
()
elif
self
.
guard
.
expr
!=
self
.
getExpression
():
self
.
guard
.
expr
=
self
.
getExpression
()
def
getVarExprText
(
self
,
id
):
if
not
self
.
var_exprs
:
return
''
else
:
expr
=
self
.
var_exprs
.
get
(
id
,
None
)
if
expr
is
not
None
:
return
expr
.
text
else
:
return
''
def
getWorkflow
(
self
):
return
aq_parent
(
aq_inner
(
aq_parent
(
aq_inner
(
self
))))
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