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

Parents
  • 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)
                                                                          )
                                                                       }
                                                     )
                                              )
                                        },
                             )
                         }
                    )
              }
         )
    )

Reply
  • 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)
                                                                          )
                                                                       }
                                                     )
                                              )
                                        },
                             )
                         }
                    )
              }
         )
    )

Children
No Data