"Insufficient privileges to perform the action." from fauna shell

Hi fauna community,

Has anyone seen the below type of error before using the fauna shell? I understood that the shell would have admin privileges though for some reason permission is being denied because there are "Insufficient privileges to perform the action.":

   Call(Function("RankRecipesForUser"), [ "nonijdctev", "egg", null, null, null])

Error: [
  {
    "position": [],
    "code": "call error",
    "description": "Calling the function resulted in an error.",
    "cause": [
      {
        "position": [
          "expr",
          "collection",
          "paginate"
        ],
        "code": "permission denied",
        "description": "Insufficient privileges to perform the action."
      }
    ]
  }
]

I have active admin and server keys for this database so am not sure where I could be going wrong.

@Jay-Fauna and @Luigi_Servini you have both been really helpful before, hoping you could set me straight before the weekend.

Can you confirm that your ~/.fauna-shell configuration file uses the correct secret? Do not post the secret here!

@Darryl_Naidu Are you able to call this function from WebShell as it uses the admin key by default?

As @ewan said, identify the endpoint, get the Key from .fauna-shell, and run KeyFromSecret to determine the role attached to it. Based on the error, You are not able to Paginate.

Hi @Jay-Fauna, I was using Shell as synonymous with WebShell. The error is being shown when I submit the call to the WebShell.

It’s interesting because I can query a paginated index in WebShell though the moment I try call a function which seeks to access the index in the same way, I get the above error.

OK, @Jay-Fauna your above point prompted me to change permissions. These were intended to be functions accessible to the client role. I had thought that Admin permissions would allow access to everything on the database. Removing the Role designation or assigning it to Admin in the UDF fixed my problem.