formioformsflow.ai

How to restrict anonymous user from some forms in form io?


Formio providing anonymous role id for access the form from formio. this is providing the data without login. so when we try to access "/form" endpoint we will get all forms. some forms we don't want to show . How to restrict the access to anonymous role id ?

/form : please check this end point


Solution

  • if you create the forms and you have not explicitly mentioned the form access object . Anonymous Role Id will be automatically added to the form read access.

        export const FORM_ACCESS =[{
        type: "read_all",
        roles:  [CLIENT_ID,
        STAFF_REVIEWER_ID,
        STAFF_DESIGNER_ID
          ]
      }]
    
     newForm.access=FORM_ACCESS
    

    you can edit the access and send it with form data. then it will consider the explicitly data