source: publico/ILSAAP/branches/2.0/Extensions/InstallWorkflows.py @ 5541

Última Alteração nesse arquivo desde 5541 foi 5541, incluída por sesostris, 9 anos atrás

Correção de falha de segurança que permitia usuários cadastrados percorressem os menus de navegação de uma workarea para a qual não possuia permissão. closes #2411

File size: 3.3 KB
Linha 
1# -*- coding: utf-8 -*-
2#
3# File: ILSAAP.py
4#
5# Copyright (c) 2008 by Interlegis
6# Generator: ArchGenXML Version 1.5.2
7#            http://plone.org/products/archgenxml
8#
9# GNU General Public License (GPL)
10#
11# This program is free software; you can redistribute it and/or
12# modify it under the terms of the GNU General Public License
13# as published by the Free Software Foundation; either version 2
14# of the License, or (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24# 02110-1301, USA.
25#
26
27__author__ = """SCT Interlegis <admin-stc@interlegis.gov.br>"""
28__docformat__ = 'plaintext'
29
30
31from Products.CMFCore.utils import getToolByName
32from Products.ExternalMethod.ExternalMethod import ExternalMethod
33
34##code-section module-header #fill in your manual code here
35##/code-section module-header
36
37def installWorkflows(self, package, out):
38    """Install the custom workflows for this product."""
39
40    productname = 'ILSAAP'
41    workflowTool = getToolByName(self, 'portal_workflow')
42
43    ourProductWorkflow = ExternalMethod('temp', 'temp',
44                                        productname+'.'+'saap_workflow',
45                                        'create_saap_workflow')
46    workflow = ourProductWorkflow(self, 'saap_workflow')
47    if 'saap_workflow' in workflowTool.listWorkflows():
48        print >> out, 'saap_workflow already in workflows.'
49    else:
50        workflowTool._setObject('saap_workflow', workflow)
51
52    workflowTool.setChainForPortalTypes(['ContactCollection'], workflow.getId())
53    workflowTool.setChainForPortalTypes(['Editorial'], workflow.getId())
54    workflowTool.setChainForPortalTypes(['Entity'], workflow.getId())
55    workflowTool.setChainForPortalTypes(['FolderContact'], workflow.getId())
56    workflowTool.setChainForPortalTypes(['FolderDocuments'], workflow.getId())
57    workflowTool.setChainForPortalTypes(['FolderNewsLetter'], workflow.getId())
58    workflowTool.setChainForPortalTypes(['LabelModel'], workflow.getId())
59    workflowTool.setChainForPortalTypes(['Letter'], workflow.getId())
60    workflowTool.setChainForPortalTypes(['Model'], workflow.getId())
61    workflowTool.setChainForPortalTypes(['NewsLetter'], workflow.getId())
62    workflowTool.setChainForPortalTypes(['Person'], workflow.getId())
63    workflowTool.setChainForPortalTypes(['PhysicalPerson'], workflow.getId())
64    workflowTool.setChainForPortalTypes(['SaapDocument'], workflow.getId())   
65    workflowTool.setChainForPortalTypes(['WorkArea'], workflow.getId())
66 
67
68    ##code-section after-workflow-install #fill in your manual code here
69    ##/code-section after-workflow-install
70
71    return workflowTool
72
73def uninstallWorkflows(self, package, out):
74    """Deinstall the workflows.
75
76    This code doesn't really do anything, but you can place custom
77    code here in the protected section.
78    """
79
80    ##code-section workflow-uninstall #fill in your manual code here
81    ##/code-section workflow-uninstall
82
83    pass
Note: Veja TracBrowser para ajuda no uso do navegador do trac.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.