lib/src/main/java/edu/utexas/tacc/tapis/files/lib/services/ParentTaskTransferService.java
private boolean checkPermissionsForParent(TransferTaskParent parentTask) throws ServiceException {
        // For http inputs no need to do any permission checking on the source
        boolean isHttpSource = parentTask.getSourceURI().getProtocol().equalsIgnoreCase("http");
        String tenantId = parentTask.getTenantId();
        String username = parentTask.getUsername();

        String srcSystemId = parentTask.getSourceURI().getSystemId();
        String srcPath = parentTask.getSourceURI().getPath();
        String destSystemId = parentTask.getDestinationURI().getSystemId();
        String destPath = parentTask.getDestinationURI().getPath();

        // If we have a tapis:// link, have to do the source perms check
        if (!isHttpSource) {
            boolean sourcePerms = permsService.isPermitted(tenantId, username, srcSystemId, srcPath, FileInfo.Permission.READ);
            if (!sourcePerms) {
                return false;
            }
        }
        boolean destPerms = permsService.isPermitted(tenantId, username, destSystemId, destPath, FileInfo.Permission.MODIFY);
        if (!destPerms) {
            return false;
        }
        return true;
    }
/**
     * This method checks the permissions on both the source and destination of the transfer.
     *
     * @param parentTask the TransferTaskParent
     * @return boolean is/is not permitted.
     * @throws ServiceException When api calls for permissions fail
     */
This method checks the permissions on both the source and destination of the transfer.
@param parentTask the TransferTaskParent
@return boolean is/is not permitted.
@throws ServiceException When api calls for permissions fail
This method checks the permissions on both the source and destination of the transfer . @param parentTask the TransferTaskParent @return boolean is / is not permitted . @throws ServiceException When api calls for permissions fail
private boolean checkPermissionsForParent(TransferTaskParent parentTask) throws ServiceException {
        boolean isHttpSource = parentTask.getSourceURI().getProtocol().equalsIgnoreCase("http");
        String tenantId = parentTask.getTenantId();
        String username = parentTask.getUsername();
        String srcSystemId = parentTask.getSourceURI().getSystemId();
        String srcPath = parentTask.getSourceURI().getPath();
        String destSystemId = parentTask.getDestinationURI().getSystemId();
        String destPath = parentTask.getDestinationURI().getPath();
        if (!isHttpSource) {
            boolean sourcePerms = permsService.isPermitted(tenantId, username, srcSystemId, srcPath, FileInfo.Permission.READ);
            if (!sourcePerms) {
                return false;
            }
        }
        boolean destPerms = permsService.isPermitted(tenantId, username, destSystemId, destPath, FileInfo.Permission.MODIFY);
        if (!destPerms) {
            return false;
        }
        return true;
    }
private boolean checkPermissionsForParent ( TransferTaskParent parentTask ) throws ServiceException { boolean isHttpSource = parentTask . getSourceURI ( ) . getProtocol ( ) . equalsIgnoreCase ( "http" ) ; String tenantId = parentTask . getTenantId ( ) ; String username = parentTask . getUsername ( ) ; String srcSystemId = parentTask . getSourceURI ( ) . getSystemId ( ) ; String srcPath = parentTask . getSourceURI ( ) . getPath ( ) ; String destSystemId = parentTask . getDestinationURI ( ) . getSystemId ( ) ; String destPath = parentTask . getDestinationURI ( ) . getPath ( ) ; if ( ! isHttpSource ) { boolean sourcePerms = permsService . isPermitted ( tenantId , username , srcSystemId , srcPath , FileInfo . Permission . READ ) ; if ( ! sourcePerms ) { return false ; } } boolean destPerms = permsService . isPermitted ( tenantId , username , destSystemId , destPath , FileInfo . Permission . MODIFY ) ; if ( ! destPerms ) { return false ; } return true ; }
This method checks the permissions on both the source and destination of the transfer.
This method checks the permissions on both the source and destination of the transfer .
// For http inputs no need to do any permission checking on the source // If we have a tapis:// link, have to do the source perms check