Skip to content

Setting Gear Permissions

Introduction

By default, gears can be used by any user site-wide.  However, Site Administrators or Site Developers can limit gear access to designated users, projects, or groups.  Learn more about the impact of gear permissions.

A site admin or site developer can update the permissions of a specific gear. Permissions are set at the group, project, or user level. Combinations and multiples are allowed. A permission of None will result in site-wide permissions, and is the default when a gear is first loaded.

Site Administrators or Gear Developers can set Gear permissions using the following functions in the the Flywheel Python SDK.

Instruction Steps

In these examples, awesome-gear is an example gear name. user@flywheel.io is an example user id, 623b89fff383de7494a88e66 is an example project id, and research is an example group id.

  • Check existing permissions on the gear
fw.get_gear_series("awesome-gear")
fw.replace_gear_permissions("awesome-gear",{"users" : ['user@flywheel.io']})
  • Remove any restrictions on the gear, setting the gear permissions to default(None)
fw.delete_gear_permissions('awesome-gear')
  • Add another user to the “awesome-gear”
fw.add_gear_permission("awesome-gear", "users", {"id":"user@flywheel.io"})
  • For group level and project level permissions, the same commands apply, but the input becomes:
fw.replace_gear_permission("awesome-gear", "users", {"id":"user@flywheel.io"}, "group", {"id":"research"})
  • To remove all permissions and make a gear inaccessible by users, provide empty lists:
fw.replace_gear_permissions(gear_name,{"users" : [], 'projects': [], 'groups':[]})