Permissions

Rainbeam expresses permissions using bitflags which join together into a single, serializable integer.

You can view the names of every permission here, with their values visible in the source here.

These permissions are demoed in the moderation.sql example. In this example, we create a default "helpers" group:

INSERT INTO
    "xgroups"
VALUES
    ('Helpers', '1', 33603612);

This group is given a permission integer of 33603612, which is built using something similar to the following:

(1 << 2) | (1 << 3) | (1 << 4) | (1 << 14) | (1 << 15) | (1 << 25)

That represents the following permissions:

  • MANAGE_RESPONSES
  • MANAGE_COMMENTS
  • MANAGE_QUESTIONS
  • VIEW_AUDIT_LOG
  • VIEW_REPORTS
  • MANAGE_WARNINGS

This also matches the minimum permissions to be marked as a "helper".