mon utilisateur ne peut pas finir une tache
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2017 09:09 AM
Bonjour,
j'ai cree un utilisateur qui appartient à un groupe Fonctionnaire. J'ai affecte une tache à ce groupe.
<userTask id="usertask5" name="User Task" activiti:candidateGroups="GROUP_Fonctionnaire" activiti:formKey="mincomdoc:submitDemande">
mais lorsque je me connecte avec cet utilisateur et je veux finir ma tache il me dit
org.alfresco.scripts.ScriptException: 00190049 Failed to execute supplied script: 00190048 Access refusé. Vous n'avez pas la permission de réaliser cette opération.
Qu'est ce qui se passe ? pourquoi je n'ai pas la permission.
- Labels:
-
Language Groups
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2017 09:18 AM
Bonjour,
Pourriez-vous fournir le workflow dans son intégralité en attachant le fichier xml ainsi que les logs alfresco lors de l'action ?
Par ailleurs, après la tâche que fait votre workflow ? Si vous avez du code (JS ou Java) effectuant des opérations sur des fichiers, il se peut que votre utilisateur ne dispose pas des droits (modification etc...) nécessaire à la réalisation de ces opérations ce qui entrainerait une erreur de ce type.
Yann
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2017 09:37 AM
ci joint mon bpmn
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns
mgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="docAdmin" name="docAdmin" isExecutable="true">
<startEvent id="startevent1" name="Saisir Matricule" activiti:formKey="mincomdoc:submitDemande"></startEvent>
<endEvent id="endevent1" name="End"></endEvent>
<exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
<userTask id="usertask2" name="mail notifier le fonctionnaire votre demande est prete" activiti:candidateGroups="GROUP_Agent_DAFF"></userTask>
<userTask id="usertask3" name="mail au fonctionnaire date prévu de livraison" activiti:candidateGroups="GROUP_Agent_DAFF">
<extensionElements>
<activiti:taskListener event="create" class="tn.mincom.mail.sender.MailSender"></activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="usertask4" name="Fournir la copie du document " activiti:candidateGroups="GROUP_Agent_DAFF" activiti:formKey="mincomdoc:submitCopieDoc">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[task.setVariableLocal('mincomdoc_matricule2','1236547');]]></activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<endEvent id="endevent2" name="End"></endEvent>
<sequenceFlow id="flow10" sourceRef="exclusivegateway1" targetRef="usertask4">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string><![CDATA[logger.log("Hello, "+execution.getVariable('isOriginal')+"!");]]></activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${mincomdoc_choixdoclist != 'Attestation du travail'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow11" sourceRef="exclusivegateway1" targetRef="usertask3">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string><![CDATA[logger.log("Hello, "+execution.getVariable('isOriginal')+"!");]]></activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${mincomdoc_choixdoclist == 'Attestation du travail'}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow12" sourceRef="usertask4" targetRef="endevent2"></sequenceFlow>
<sequenceFlow id="flow13" sourceRef="usertask3" targetRef="usertask2"></sequenceFlow>
<sequenceFlow id="flow16" sourceRef="usertask2" targetRef="endevent1"></sequenceFlow>
<serviceTask id="alfrescoScripttask1" name="Generer PDF et envoie mail au daffeur" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
<extensionElements>
<activiti:field name="script">
<activiti:string><![CDATA[pdfGenerator.generatePDF(execution , search.xpathSearch('/app:company_home')[0]);]]></activiti:string>
</activiti:field>
</extensionElements>
</serviceTask>
<sequenceFlow id="flow18" sourceRef="alfrescoScripttask1" targetRef="exclusivegateway1">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string><![CDATA[var isOriginal ;
execution.setVariable( 'isOriginal' , (execution.getVariable('mincomdoc_choixdoclist')) =='Attestation du travail' ) ;
logger.log("Hello, "+execution.getVariable('isOriginal')+"!");]]></activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
</sequenceFlow>
<userTask id="usertask5" name="User Task" activiti:candidateGroups="GROUP_Fonctionnaire" activiti:formKey="mincomdoc:submitDemande">
<extensionElements>
<activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[execution.setVariable('mincomdoc_matricule','1236547');
logger.log("Hello, "+execution.getVariable('mincomdoc_matricule')+"!");]]></activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
</userTask>
<sequenceFlow id="flow19" sourceRef="startevent1" targetRef="usertask5"></sequenceFlow>
<sequenceFlow id="flow20" sourceRef="usertask5" targetRef="alfrescoScripttask1"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_docAdmin">
<bpmndi:BPMNPlane bpmnElement="docAdmin" id="BPMNPlane_docAdmin">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35.0" width="35.0" x="30.0" y="243.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="800.0" y="355.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
<omgdc:Bounds height="40.0" width="40.0" x="360.0" y="240.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
<omgdc:Bounds height="85.0" width="105.0" x="640.0" y="330.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3">
<omgdc:Bounds height="91.0" width="115.0" x="440.0" y="330.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask4" id="BPMNShape_usertask4">
<omgdc:Bounds height="81.0" width="105.0" x="510.0" y="120.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
<omgdc:Bounds height="35.0" width="35.0" x="712.0" y="143.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="alfrescoScripttask1" id="BPMNShape_alfrescoScripttask1">
<omgdc:Bounds height="89.0" width="105.0" x="152.0" y="267.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="usertask5" id="BPMNShape_usertask5">
<omgdc:Bounds height="55.0" width="105.0" x="65.0" y="120.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
<omgdi:waypoint x="380.0" y="240.0"></omgdi:waypoint>
<omgdi:waypoint x="380.0" y="160.0"></omgdi:waypoint>
<omgdi:waypoint x="510.0" y="160.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
<omgdi:waypoint x="380.0" y="280.0"></omgdi:waypoint>
<omgdi:waypoint x="380.0" y="375.0"></omgdi:waypoint>
<omgdi:waypoint x="440.0" y="375.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
<omgdi:waypoint x="615.0" y="160.0"></omgdi:waypoint>
<omgdi:waypoint x="712.0" y="160.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow13" id="BPMNEdge_flow13">
<omgdi:waypoint x="555.0" y="375.0"></omgdi:waypoint>
<omgdi:waypoint x="640.0" y="372.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16">
<omgdi:waypoint x="745.0" y="372.0"></omgdi:waypoint>
<omgdi:waypoint x="800.0" y="372.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
<omgdi:waypoint x="257.0" y="311.0"></omgdi:waypoint>
<omgdi:waypoint x="380.0" y="280.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow19" id="BPMNEdge_flow19">
<omgdi:waypoint x="47.0" y="243.0"></omgdi:waypoint>
<omgdi:waypoint x="117.0" y="175.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow20" id="BPMNEdge_flow20">
<omgdi:waypoint x="117.0" y="175.0"></omgdi:waypoint>
<omgdi:waypoint x="204.0" y="267.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
Apres la tache, j'execute un script 'alfrescoScripttask1' qui fait generer un pdf.
pdfGenerator.generatePDF(execution , search.xpathSearch('/app:company_home')[0]);
mon log:
2017-01-19 15:11:34,409 DEBUG [repo.jscript.ScriptLogger] [http-apr-8181-exec-3] json form submission for item:
2017-01-19 15:11:34,409 DEBUG [repo.jscript.ScriptLogger] [http-apr-8181-exec-3] kind = task
2017-01-19 15:11:34,409 DEBUG [repo.jscript.ScriptLogger] [http-apr-8181-exec-3] id = activiti$16146
2017-01-19 15:11:34,579 ERROR [pdf.generator.PdfGenerator] [http-apr-8181-exec-3] ==================== pdf generation started =======================
2017-01-19 15:11:34,585 DEBUG [repo.jscript.ScriptLogger] [http-apr-8181-exec-3] org.alfresco.scripts.ScriptException: 00190049 Failed to execute supplied script: 00190048 Access refusé. Vous n'avez pas la permission de réaliser cette opération.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2017 09:45 AM
Je pense que j'ai resolu le probleme, la permission est non autorise pour la generation du pdf.
j'ai modifie mon script
<serviceTask id="alfrescoScripttask1" name="Generer PDF et envoie mail au daffeur" activiti:class="org.alfresco.repo.workflow.activiti.script.AlfrescoScriptDelegate">
<extensionElements>
<activiti:field name="script">
<activiti:string><![CDATA[pdfGenerator.generatePDF(execution , search.xpathSearch('/app:company_home')[0]);]]></activiti:string>
</activiti:field>
<activiti:field name="runAs">
<activiti:string><![CDATA[admin]]></activiti:string>
</activiti:field>
</extensionElements>
</serviceTask>
et maintenant ca marche.
Merci bien Yann Coulon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2017 10:01 AM
Bonjour,
Bien que fonctionnelle cette solution présente un inconvénient et de taille : la tâche est exécuté avec les permissions admin ce qui créé un gros trou de sécurité !
Pour bien faire, il aurait fallut modifier le chemin de génération du PDF pour un espace sur lequel les membres du groupes affecté à cette tâche disposent des droits suffisant pour écrire (et ou modifier).
Yann
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2017 10:17 AM
Merci beaucoup. C'est fait, et ca marche.
