ItemOtherPermissions

Overview

ItemOtherPermissions objects describe world permissions on an item.
To access this object, use the other property of the associated Item.

Methods and properties

Changing world permissions

canRead Boolean

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

canWrite Boolean

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

canExecute Boolean

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

Setting multiple properties at once

self set(Object values)

For each key-value couple in values, sets the key attribute of the ItemOtherPermissions 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').other;
scriptPermissions.set({
	canWrite: false,
	canExecute: true
});

return scriptPermissions.canWrite; // returns `false`