39

I keep getting this error message when I try to view my deployed app.

Authorisation is required to perform that action

How do I get around the error?

Services in use in the script:

  • ScriptDB
  • UiApp

(I think that is all)

I can't find the answer in the documentation, so I would be very grateful for some help.

ziganotschka
  • 25,866
  • 2
  • 16
  • 33
Ryan Smith
  • 1,255
  • 2
  • 13
  • 16

1 Answers1

74

You need to go the script editor and attempt to run any function manually first.

A first authorization popup is shown when you first deploy as web app, but if you go and change the code accessing new services you have to re-authorize it.

Henrique G. Abreu
  • 17,406
  • 3
  • 56
  • 65
  • As far as running each function manually first goes that is not possible for me and the current debugger as I have made my own objects and it wont debug/run the functions within them for whatever reason. – Ryan Smith Jul 10 '12 at 21:11
  • I take it you meant running the function directly using the drop down to select a function rather than just simply calling the functions... – Ryan Smith Jul 10 '12 at 21:13
  • 6
    Yes, just go to the script editor and try to run any function. If the script is indeed not authorized, as suggested by the message, the function will not run and a authorization popup will show up so you can do it. If it runs and fails because they do not have a expected parameter, that's no a problem. We were not actually trying to run it, just authorize. You may create an empty function e.g. `function auth() {}` just to safely do nothing if you want (besides popping up the authorization window). – Henrique G. Abreu Jul 10 '12 at 21:30
  • Ok I will try that today and reply back here. I'm fairly certain that will solve the problem so thanks for your help and quick responses. – Ryan Smith Jul 11 '12 at 06:50
  • Yeah that worked and I only had to do one function and it authorised all of the services the code uses. Thanks a lot :) – Ryan Smith Jul 11 '12 at 17:50
  • Problem, when I use UserProperties service and deploy the web app I get this error again, but when I debug I do not and I have already had the authorisation message pop up so it now isn't popping up. Any ideas? – Ryan Smith Jul 13 '12 at 19:06
  • 1
    Problem solved. I changed it to execute as user running the web app. – Ryan Smith Jul 13 '12 at 19:25
  • @RyanSmith how did you solve the permission error? do you know how to remove the permission? I have a link in the email that lets other users change the value of a row in the spreadsheet but it keeps saying permission error. – Skeeith22 Jan 13 '21 at 14:35