_requirePermission
Contract: JBOperatable
- Step by step
- Code
- Errors
- Bug bounty
Require the message sender is either the account or has the specified permission.
Definition
function _requirePermission(
address _account,
uint256 _domain,
uint256 _permissionIndex
) internal view { ... }
- Arguments:
_account
is the account to allow._domain
is the domain namespace within which the permission index will be checked._permissionIndex
is the permission index that an operator must have within the specified domain to be allowed.
- The resulting function is internal to this contract and its inheriters.
- The function doesn't return anything.
Body
Make sure the message sender is the specified account, an operator of the account within the specified domain, or an operator of the account within the wildcard domain.
if (
msg.sender != _account &&
!operatorStore.hasPermission(msg.sender, _account, _domain, _permissionIndex) &&
!operatorStore.hasPermission(msg.sender, _account, 0, _permissionIndex)
) revert UNAUTHORIZED();Internal references:
External references:
/**
@notice
Require the message sender is either the account or has the specified permission.
@param _account The account to allow.
@param _domain The domain namespace within which the permission index will be checked.
@param _permissionIndex The permission index that an operator must have within the specified domain to be allowed.
*/
function _requirePermission(
address _account,
uint256 _domain,
uint256 _permissionIndex
) internal view {
if (
msg.sender != _account &&
!operatorStore.hasPermission(msg.sender, _account, _domain, _permissionIndex) &&
!operatorStore.hasPermission(msg.sender, _account, 0, _permissionIndex)
) revert UNAUTHORIZED();
}
String | Description |
---|---|
UNAUTHORIZED | Thrown if the message sender is neither the specified account nor an operator of the specified account. |
Category | Description | Reward |
---|---|---|
Optimization | Help make this operation more efficient. | 0.5ETH |
Low severity | Identify a vulnerability in this operation that could lead to an inconvenience for a user of the protocol or for a protocol developer. | 1ETH |
High severity | Identify a vulnerability in this operation that could lead to data corruption or loss of funds. | 5+ETH |