Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#817844
Hello,

I want to allow the users of a task to access the Signed Contract Document to validate its content in every new Order. So, I created a Link field where I have the URL for the Input document creted in another process case. But I'm getting an "Access denied" message page.

The trigger code is the following:

if ($caseId != null){
$query = "SELECT C.CON_ID AS fileId, C.CON_VALUE AS filename
FROM APP_DOCUMENT AD, CONTENT C
WHERE AD.APP_UID='$caseId' AND AD.APP_DOC_TYPE='INPUT' AND AD.APP_DOC_STATUS='ACTIVE' AND
AD.APP_DOC_UID=C.CON_ID AND C.CON_CATEGORY='APP_DOC_FILENAME' AND C.CON_VALUE<>''
ORDER BY AD.APP_DOC_CREATE_DATE DESC";
$result = executeQuery($query);
if (is_array($result) and count($result) > 0) {
//Relative URL to download Input Document file inside ProcesMaker:
$host= gethostname();
$ip = gethostbyname($host);
@@lnkContractFile = $ip . ':' . $_SERVER['SERVER_PORT'] . '/sys' . @@SYS_SYS . '/' . @@SYS_LANG . '/' . @@SYS_SKIN . '/cases/cases_ShowDocument?a=' . $result[1]['fileId'];
@@lnkContractFile_label = $result[1]['filename'];
}
}

NOTE: On the documentation it is suggested to put only: '../cases/cases_ShowDocument?a=' . $result[1]['fileId']; for the @@lnkContractFile variable but I never could make it work. That's why I'm building the whole string.
Attachments
Capturar.PNG
Capturar.PNG (30.22 KiB) Viewed 2191 times
#817915
Hi,
I found out that setting this flag "disable_download_documents_session_validation" to 1 on env.ini will allow all users to download Input Documents.
But, I would like to give permissions to some user groups only. I tested by giving permissions to the group in the process where the Input Document is uploaded and in the process where I want the users to download the document ,but didn´t work
out!
How can it be done?
Thanks.
#817932
If this is a link to an Input Document, then you can create a Process Permission to give the group access to the Input Document. If the file was uploaded in a File or MultipleFile field, then you can create a Process Permission to give the group access the DynaForm containing the File/MultipleFile field.

If you are placing this URL in an email or an output document, then you will see the "Access Denied" message when the user clicks on the link, because he/she doesn't have an open login session in his web browser. The user will need to first log into ProcessMaker and then click on the link (or paste the URL into the web browser's address bar).

If you want to avoid the manual login by the user, then you will need to change PM's source code. See:
viewtopic.php?f=44&t=730371&p=813761#p813761

Experience heightened pleasure with Cenforce 100 M[…]

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]

Betvisa clone scripts are pre-built software solut[…]