Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

Display only data entity where the document is accessible by the user

Hello,

I have a table that contains the document id and some document metadata. I want to display a grid with these data and a link to the document but all documents are not accessible by the logged in user. I want to display only row that refer to a document accessible by the user. I try something like this:

if (isnull(todocument(fv!row.docid)),

/* do not display */,

/display the row */

)

I also test

if (todocument(fv!row.docid)="[NO PERMISSION]"

but it doesn't work. How can I tests if the user have access to a specific document ?

Thanks for your help

  Discussion posts and replies are publicly visible

  • Here under an example of what I want to do. With this interface, the user can display a list of document based on a metadata, here the document type (business type, not the extension). This code work fine but all documents are displayed else the user has not access to it due to permission on the folder. I want to display only documents that the use can access.

    a!localVariables(
       a!columnsLayout(
          columns: {
              a!columnLayout(
                 contents: {
                     a!dropdownField(
                                      label: "Document type",
                                      labelPosition: "ABOVE",
                                      choiceLabels: {"Type 1", "Type 2", "Type 3", "Type 4"},
                                      choiceValues: {"Type 1", "Type 2", "Type 3", "Type 4"},
                                      value: ri!searh,
                                      saveInto: ri!searh,
                                      searchDisplay: "AUTO",
                                      validations: {}
                     ),
                     a!gridField(
                                      data: a!queryEntity(
                                            entity: cons!ITT_DSE_DOCUMENT_METADATA,
                                            query: a!query(
                                                selection: a!querySelection(
                                                columns: {
                                                       a!queryColumn( field: "id" ),
                                                       a!queryColumn(field: "docId"),
                                                       a!queryColumn(field: "documentType")
                                                     }
                                                 ),
                                                 logicalExpression: a!queryLogicalExpression(
                                                       operator: "AND",
                                                       filters: {
                                                              a!queryFilter(
                                                                  field: "documentType",
                                                                  operator: "=",
                                                                  value: ri!searh
                                                              )
                                                       },
                                                       ignoreFiltersWithEmptyValues: true
                                                 ),
                                          ),
                                          fetchTotalCount: true
                                     ),
                                     columns: {
                                           a!gridColumn(
                                                   label: "#",
                                                   sortField: "id",
                                                   value: fv!row.id,
                                                   align: "CENTER"
                                            ),
                                            a!gridColumn(
                                                    label: "document id",
                                                    value: a!linkField(
                                                             links: {
                                                                          a!documentDownloadLink(
                                                                                   label: fv!row.docId,
                                                                                   document: todocument(fv!row.docId)
                                                                          )
                                                                       }
                                                     )
                                              )
                                        },
                             )
                         }
                    )
              }
         )
    )