Skip to content

Commit

Permalink
[BugFix] Grant builtin storage volume usage in follower (#28567)
Browse files Browse the repository at this point in the history
Signed-off-by: Zijie Lu <[email protected]>
  • Loading branch information
TszKitLo40 authored Aug 4, 2023
1 parent 874ce0c commit 7e7f840
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1811,15 +1811,9 @@ public void upgradeRoleInitPrivilegeUnlock(long roleId, RolePrivilegeCollectionV
}

public void grantStorageVolumeUsageToPublicRole(String storageVolumeId) throws PrivilegeException {
roleWriteLock();
try {
RolePrivilegeCollectionV2 collection = getRolePrivilegeCollectionUnlocked(PrivilegeBuiltinConstants.PUBLIC_ROLE_ID,
true);
List<PEntryObject> object = Collections.singletonList(new StorageVolumePEntryObject(storageVolumeId));
collection.grant(ObjectType.STORAGE_VOLUME, Collections.singletonList(PrivilegeType.USAGE), object, false);
} finally {
roleWriteUnlock();
}
List<PEntryObject> object = Collections.singletonList(new StorageVolumePEntryObject(storageVolumeId));
grantToRole(ObjectType.STORAGE_VOLUME, Collections.singletonList(PrivilegeType.USAGE), object, false,
PrivilegeBuiltinConstants.PUBLIC_ROLE_NAME);
}

public void loadV2(SRMetaBlockReader reader) throws IOException, SRMetaBlockException, SRMetaBlockEOFException {
Expand Down

0 comments on commit 7e7f840

Please sign in to comment.