ItemGroupPermissions

Overview

ItemGroupPermissions objects describe the owning group of an Item, and its permissions on the item.
To access this object, use the group property of the associated Item.

Methods and properties

Owner group identity

name String

The name of the owning group.
sample Set the owning group by name
let recipes = here.file('recipes.md');
recipes.group.name = 'staff';

id Number

The id of the owning group.
sample Copy the owning group of another file
const recipes = here.file('recipes.md');
let ingredients = here.file('ingredients.md');
ingredients.group.id = recipes.group.id;

Owner group permissions

canRead Boolean

Whether the owning group can read the item.
sample Make a file group-readable
const recipes = here.file('recipes.md');
recipes.group.canRead = true;

canWrite Boolean

Whether the owning group can write the item.
sample Make a file group-writeable
const recipes = here.file('recipes.md');
recipes.group.canWrite = true;

canExecute Boolean

Whether the owning group can execute the item.
sample Make a file group-executable
const recipes = here.file('recipes.md');
recipes.group.canExecute = true;

Setting multiple properties at once

self set(Object values)

For each key-value couple in values, sets the key attribute of the ItemGroupPermissions to value. This makes it easy to set multiple attributes on the object at once.
values
A map of property names and values.
sample Change write and execute permissions in one call
let scriptPermissions = here.file('script.js').group;
scriptPermissions.set({
	canWrite: false,
	canExecute: true
});

return scriptPermissions.canWrite; // returns `false`