I've written a tiny script/ macro in google sheets when an image is clicked, some boxes in cells get unticked, when I first used clicked it myself, I had to give permission for myself.
My question is, the other user that I share these sheets with, will they now have permission automatic permission?
I ask because they are not computer literate and won't be able to grant themselves permission.
Apps Script scans the code automatically and determines which are the authorization scopes. In this case, all users you share the spreadsheet with will have to grant explicit permission for the script to modify the file on their behalf. This cannot be avoided.
Check this out for more information: https://developers.google.com/apps-script/guides/services/authorization
Related
I added a Doc that has a bunch of custom onOpen() scripts to the template library, when I select the document template and create a new document the scripts no longer work. It seems to be some kind of permissions issue because when I go to edit the script within the new document I'm asked to Allow permission, I select allow, and then the script starts working. I need the permission to be granted by default!
I need the permission to be granted by default!
This is unfortunately not possible :( Please refer Container-bound Scripts > Access to bound scripts.
As it indicates -
Only users who have permission to edit a container can run its bound
script. Collaborators who have only view access cannot open the
script editor, although if they make a copy of the parent file, they
become the owner of the copy and will be able to see and run a copy
of the script.
As a solution perhaps, "...you can force the authorization dialog..." as indicated at Manual authorization scopes for Sheets, Docs, Slides, and Forms.
Hope this helps!
I am using Google Sheets as an online database for six users. It has buttons that run scripts mainly to hide/unhide sheets. People I share it with, tell me they require permission or authorization when they activate the button to run the script. I don't know how to grant permission. Can anyone help, please?
the script is attached to your spreadsheet and at some point, you authorized the script for your spreadsheet. now if you share that spreadsheet then all your people will need to do the same - authorize the script for a given spreadsheet for themselves (in other words, they need to allow running those scripts because all non-authorized scripts are by default disabled).
prompt them to enter script editor and press run button (triangle-shaped). a window will pop up with the question if they want to authorize those scripts. when they do they can use those scripts too.
if you are advanced script user you can set up an installable trigger for your spreadsheet to ease this process
I've a public Google Sheet (everyone can access it and edit it). In it, I use a script, a function, that download a csv with the UrlFetchApp.fetch(url);.
When an anonymous user access it (without the google login), the user can view, and edit the sheet, but, the user cannot run the script. The user must be logged with a google account to the script do the working.
The stranger thing is that this sheet with this script was working for anonymous users early. This problem didn't occur before a couple weeks ago.
Do you know if the google change something about security or is it an error that I am doing?
In order to run apps script on a particular user's behalf, Google Workspace requires that user's permission, via an OAuth flow.
If a user is anonymous therefore, you can see why this permission cannot be granted, which is why the script won't work for those users.
I guess it is an intended behavior as long as the anonymous user access the sheet via shareable link. As stated in this support page, you might see a name you don’t recognize or "anonymous animals" viewing your document, spreadsheet, or presentation. This can happen when a document is shared publicly or with anyone who has the link.
Limit how people can view your file
If you want to stop sharing a file you can edit, you can learn how to:
Turn off link sharing for a file.
Prevent others from sharing files you own.
Hope this helps.
I mistakenly revoked permissions on a google-apps-script that ran on a time trigger on a google spreadsheet from here: https://myaccount.google.com/permissions . I now receive an email that the script fails to run. Going to the spreadsheet and editing the script fails to bring up the script, presumably because of the lack of permissions, but no error is shown, just a blank script editor. I am able to see the trigger to the script (here: https://script.google.com/macros/triggers?id=some_id ), but I am not able to get to the script.
How can I restore or reinstate the permissions to this script?
Or how can I get the code to this script? Where is it stored?
If you simply revoked permissions it will not remove the actual script/coding. So it may not be attached to the spreadsheet you are opening. Perhaps you are opening the wrong spreadsheet, or it is a standalone- If you type type:script into your google drive search it will show all scripts that are not bound to a spreadsheet.
As far as restoring you will just want to run it, once you find it.
I was successful. I'm not sure what did it but: previously I was not able to view the script, looking at the revision history doesn't allow me to get access to the menu and thus I was not able to get at older versions of the script. But making a copy of the spreadsheet then allowed me to view the script again, both in the original and copy of the spreadsheet. Running the script then requests for permission, restoring the permissions!
I really don't know if the lack of access to the script was a temporary condition or required that I make a copy of the spreadsheet, but this was the sequence of events that worked for me.
Thank you #OblongMedulla for making the suggestions.
You can simply go to your Google Profile - Manage Your Google Account - Security - Third Party Apps and revoke the permissions. If you want to use the app again, you'll have to run the script again from appscript and grant the permissions.
We have a Google Apps domain. The domain has a sheet with a Google Apps Script add-on. We have to share this sheet with people outside our organisation. The add-on is used to refresh the data displayed in the spreadsheet.
When someone who isn't logged in opens the shared link, the add-on is not available for them. Is there a way to get around this?
You will not be able to get around the restriction that requires the user to be logged in.
Your add-on modifies spreadsheet contents on behalf of the user.
That operation requires authorization from the user.
Only logged-in users can grant authorization.
Reference: Develop Add-ons for Google Sheets, Docs, and Forms - Authorization
A separate web service that ran as you, say, and was accessible to "Everyone, including anonymous", could modify a spreadsheet without requiring a user to be logged in. You could not make this part of the Sheets UI, though.