Skip to content

Permissions

Open Markdown

Put the services that your addon uses in permissions. The player reads this list before they give consent. Viewpoint refuses a call that is not in the list.

permissions=hooks,files,downloads
hooks.targets=zombie.characters.IsoPlayer
files.quotaMiB=16
downloads.hosts=github.com,objects.githubusercontent.com
PermissionOpensKeysPage
hooks@Hook handlers, and @Patch classes in an addon jar. Game methods and listed methods of Viewpoint.hooks.targetsManaged patching
filesAddonFiles: a folder for your addon, with a quotafiles.quotaMiB (optional)Files
downloadsAddonDownloads: a download that the player accepts each timedownloads.hostsDownloads
lua@LuaExport: Java functions that the Lua of any mod can calllua.globals (optional)Lua exports
cameraCamera layers, camera claims, look control, view control and cursor claimsNoneCamera layers
combatAim and shot listeners, sway, shot resolvers and reticlesNoneAim & shots
modelsModelProvider and AttachmentProviderNoneModel providers
shadersShaderValues and AddonSnippetsNoneShader values, Shader snippets
drawDrawCallback and the Gpu objectdraw.gpuMiB (optional)Draw callbacks
vramMore than 128 MiB of video memory for the Gpu objectsdraw.gpuMiBDraw callbacks

These need no permission:

  • the view state;
  • your settings, your settings page and your keys;
  • your own assets;
  • services (Services). A new exports= package needs the player’s consent.
UseWithout the permission
AddonFilesEach call gives a SecurityException.
AddonDownloadsEach call gives a SecurityException.
A registration through the context, for example a camera layer, a provider or a draw callbackThe call gives a SecurityException.
@HookViewpoint refuses the jar when it reads it.
A hook on a class that is not in hooks.targetsViewpoint refuses the jar when it reads it.
@LuaExportViewpoint refuses the jar when it reads it.

A permission is not a label. The permissions list what the addon asks for. The label tells what the code uses. The card shows both, on the Trust and Permissions tabs.

  • A hook can keep the label Normal. Its target must be a game method that Viewpoint has reviewed. It must use thread = MAIN and a fast handler.
  • A thread = ANY hook makes the label Amber.
  • A draw permission makes the label Amber: the addon draws with OpenGL.
  • java.nio.file makes the label Red, also with the files permission. Use AddonFiles.

These changes need the player’s consent again:

  • a new permission;
  • a new class in hooks.targets;
  • a new hooked member of Viewpoint;
  • a new host in downloads.hosts;
  • a larger files.quotaMiB;
  • a new Lua export or Lua global;
  • a new snippet point or draw point;
  • a new kind of claim (camera, view, shot resolver, reticle or cursor);
  • a new exports= package, or a new requires;
  • a new member of Viewpoint that you use, reflect or hook.

Until the player gives consent, the addon stays off. This is also true if it was active before. See Updates & changelogs.