跳到主要内容

JBPermissioned

Git Source

Inherits: Context, IJBPermissioned

Modifiers to allow access to transactions based on which permissions the message's sender has.

State Variables

PERMISSIONS

A contract storing permissions.

IJBPermissions public immutable override PERMISSIONS;

Functions

constructor

constructor(IJBPermissions permissions);

Parameters

NameTypeDescription
permissionsIJBPermissionsA contract storing permissions.

_requirePermissionFrom

Require the message sender to be the account or have the relevant permission.

function _requirePermissionFrom(address account, uint256 projectId, uint256 permissionId) internal view;

Parameters

NameTypeDescription
accountaddressThe account to allow.
projectIduint256The project ID to check the permission under.
permissionIduint256The required permission ID. The operator must have this permission within the specified project ID.

_requirePermissionAllowingOverrideFrom

If the 'alsoGrantAccessIf' condition is truthy, proceed. Otherwise, require the message sender to be the account or have the relevant permission.

function _requirePermissionAllowingOverrideFrom(
address account,
uint256 projectId,
uint256 permissionId,
bool alsoGrantAccessIf
)
internal
view;

Parameters

NameTypeDescription
accountaddressThe account to allow.
projectIduint256The project ID to check the permission under.
permissionIduint256The required permission ID. The operator must have this permission within the specified project ID.
alsoGrantAccessIfboolAn override condition which will allow access regardless of permissions.

Errors

JBPermissioned_Unauthorized

error JBPermissioned_Unauthorized(address account, address sender, uint256 projectId, uint256 permissionId);