I've been trying to get some custom validations and access checks done in spreadsheets, based on the groups the users belong to.
As far as I know, the following trigger bound to a container(a spreadsheet) should have the rights of the user accessing the spreadsheet:
function onEdit(event) {
var groups = GroupsApp.getGroups();
Logger.log(groups);
}
Still, it runs into an error: "Execution failed: You do not have permission to call getGroups". The same function called from a standalone script file(in theory the same access) will see the groups of the user.
My questions are:
- Am I doing something wrong?
- If not, is there a way to access the groups of a user from a spreadsheet event?
Probably not relevant, but using Windows 8 and Chrome 30.0.1599.101 m.