in data-catalog-api/server/custos-sharing/src/main/java/org/apache/airavata/datacatalog/api/sharing/SharingManagerImpl.java [180:199]
public void grantPermissionToUser(UserInfo userInfo, DataProduct dataProduct, Permission permission,
UserInfo sharedByUser)
throws SharingException {
List<String> userIds = new ArrayList<>();
userIds.add(userInfo.getUserId());
String sharedByUserId = sharedByUser != null ? sharedByUser.getUserId() : null;
try {
createDataProductEntityIfMissing(dataProduct);
// OWNER permission can't be assigned but it is granted when the data product is
// created
if (permission != Permission.OWNER) {
custosSharingImpl.shareEntity(userInfo.getTenantId(),
dataProduct.getDataProductId(), permission.name(), userIds, true, Constants.USER,
sharedByUserId);
}
} catch (CustosSharingException e) {
throw new SharingException(e);
}
}