From 3516a5dcbe43ed477036f227394e6c136e28009b Mon Sep 17 00:00:00 2001 From: jango <77952627+mejango@users.noreply.github.com> Date: Mon, 22 May 2023 18:47:25 -0300 Subject: [PATCH] Update JBOwnableOverrides.sol I was trying to set the Croptop contract as the operator just for projectId 748, but realized that it only works if i set the `domain` to 0 (wildcard). I do not want the Croptop contract to have posting access to all my projects, just this one! --- src/JBOwnableOverrides.sol | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/JBOwnableOverrides.sol b/src/JBOwnableOverrides.sol index 44a623b..45eaa50 100644 --- a/src/JBOwnableOverrides.sol +++ b/src/JBOwnableOverrides.sol @@ -98,10 +98,12 @@ abstract contract JBOwnableOverrides is Context, IJBOwnable, IJBOperatable { /** @notice Only allows callers that have received permission from the projectOwner for this project. - + + @param _domain The domain namespace to look for an operator within. @param _permissionIndex The index of the permission to check for. */ modifier requirePermissionFromOwner( + uint256 _domain, uint256 _permissionIndex ) { JBOwner memory _ownerData = jbOwner; @@ -109,7 +111,7 @@ abstract contract JBOwnableOverrides is Context, IJBOwnable, IJBOperatable { address _owner = _ownerData.projectId == 0 ? _ownerData.owner : projects.ownerOf(_ownerData.projectId); - _requirePermission(_owner, _ownerData.projectId, _permissionIndex); + _requirePermission(_owner, _domain, _permissionIndex); _; }