From bb7fa52d57fbbb714ff04fb9161d6da58210fc72 Mon Sep 17 00:00:00 2001 From: Mike Conway Date: Tue, 30 Oct 2018 13:20:15 -0400 Subject: [PATCH] #1 merge latest master --- .../configuration/ConfigServiceImpl.java | 88 +++++---- .../services/irods/CollectionServiceImpl.java | 184 +++++++++++------- .../services/irods/IRODSServicesImpl.java | 11 +- .../interfaces/CollectionService.java | 72 +++++-- .../services/interfaces/ConfigService.java | 16 +- .../services/interfaces/IRODSServices.java | 14 +- 6 files changed, 251 insertions(+), 134 deletions(-) diff --git a/emc-metalnx-services/src/main/java/com/emc/metalnx/services/configuration/ConfigServiceImpl.java b/emc-metalnx-services/src/main/java/com/emc/metalnx/services/configuration/ConfigServiceImpl.java index ef118bd..09afa5a 100755 --- a/emc-metalnx-services/src/main/java/com/emc/metalnx/services/configuration/ConfigServiceImpl.java +++ b/emc-metalnx-services/src/main/java/com/emc/metalnx/services/configuration/ConfigServiceImpl.java @@ -1,7 +1,5 @@ - /* Copyright (c) 2018, University of North Carolina at Chapel Hill */ - /* Copyright (c) 2015-2017, Dell EMC */ - - +/* Copyright (c) 2018, University of North Carolina at Chapel Hill */ +/* Copyright (c) 2015-2017, Dell EMC */ package com.emc.metalnx.services.configuration; @@ -78,6 +76,9 @@ public class ConfigServiceImpl implements ConfigService { @Value("${access.proxy}") private boolean handleNoAccessViaProxy; + @Value("${irods.auth.scheme}") + private String defaultIrodsAuthScheme; + @Override public GlobalConfig getGlobalConfig() { logger.info("getGlobalConfig()"); @@ -174,43 +175,45 @@ public void setTicketsEnabled(boolean ticketsEnabled) { @Override public String toString() { + final int maxLen = 10; StringBuilder builder = new StringBuilder(); - builder.append("ConfigServiceImpl ["); - if (msiAPIVersionSupported != null) { - builder.append("msiAPIVersionSupported=").append(msiAPIVersionSupported).append(", "); - } - if (mlxMSIsExpected != null) { - builder.append("mlxMSIsExpected=").append(mlxMSIsExpected).append(", "); - } - if (irods41MSIsExpected != null) { - builder.append("irods41MSIsExpected=").append(irods41MSIsExpected).append(", "); - } - if (irods42MSIsExpected != null) { - builder.append("irods42MSIsExpected=").append(irods42MSIsExpected).append(", "); - } - if (otherMSIsExpected != null) { - builder.append("otherMSIsExpected=").append(otherMSIsExpected).append(", "); - } - if (irodsHost != null) { - builder.append("irodsHost=").append(irodsHost).append(", "); - } - if (irodsPort != null) { - builder.append("irodsPort=").append(irodsPort).append(", "); - } - if (irodsZone != null) { - builder.append("irodsZone=").append(irodsZone).append(", "); - } - if (irodsJobUser != null) { - builder.append("irodsJobUser=").append(irodsJobUser).append(", "); - } - - if (irodsAuthScheme != null) { - builder.append("irodsAuthScheme=").append(irodsAuthScheme).append(", "); - } - builder.append("populateMsiEnabled=").append(populateMsiEnabled).append(", ticketsEnabled=") + builder.append("ConfigServiceImpl [msiAPIVersionSupported=").append(msiAPIVersionSupported) + .append(", mlxMSIsExpected=").append(mlxMSIsExpected).append(", irods41MSIsExpected=") + .append(irods41MSIsExpected).append(", irods42MSIsExpected=").append(irods42MSIsExpected) + .append(", otherMSIsExpected=").append(otherMSIsExpected).append(", irodsHost=").append(irodsHost) + .append(", irodsPort=").append(irodsPort).append(", irodsZone=").append(irodsZone) + .append(", irodsJobUser=").append(irodsJobUser).append(", irodsAuthScheme=").append(irodsAuthScheme) + .append(", populateMsiEnabled=").append(populateMsiEnabled).append(", ticketsEnabled=") .append(ticketsEnabled).append(", uploadRulesEnabled=").append(uploadRulesEnabled) .append(", downloadLimit=").append(downloadLimit).append(", handleNoAccessViaProxy=") - .append(handleNoAccessViaProxy).append("]"); + .append(handleNoAccessViaProxy).append(", defaultIrodsAuthScheme=").append(defaultIrodsAuthScheme) + .append(", getGlobalConfig()=").append(getGlobalConfig()).append(", getMsiAPIVersionSupported()=") + .append(getMsiAPIVersionSupported()).append(", getMlxMSIsExpected()=") + .append(getMlxMSIsExpected() != null + ? getMlxMSIsExpected().subList(0, Math.min(getMlxMSIsExpected().size(), maxLen)) + : null) + .append(", getIrods41MSIsExpected()=") + .append(getIrods41MSIsExpected() != null + ? getIrods41MSIsExpected().subList(0, Math.min(getIrods41MSIsExpected().size(), maxLen)) + : null) + .append(", getIrods42MSIsExpected()=") + .append(getIrods42MSIsExpected() != null + ? getIrods42MSIsExpected().subList(0, Math.min(getIrods42MSIsExpected().size(), maxLen)) + : null) + .append(", getOtherMSIsExpected()=") + .append(getOtherMSIsExpected() != null + ? getOtherMSIsExpected().subList(0, Math.min(getOtherMSIsExpected().size(), maxLen)) + : null) + .append(", getIrodsHost()=").append(getIrodsHost()).append(", getIrodsPort()=").append(getIrodsPort()) + .append(", getIrodsZone()=").append(getIrodsZone()).append(", getIrodsJobUser()=") + .append(getIrodsJobUser()).append(", getIrodsJobPassword()=").append(getIrodsJobPassword()) + .append(", getIrodsAuthScheme()=").append(getIrodsAuthScheme()).append(", getDownloadLimit()=") + .append(getDownloadLimit()).append(", isPopulateMsiEnabled()=").append(isPopulateMsiEnabled()) + .append(", isTicketsEnabled()=").append(isTicketsEnabled()).append(", isUploadRulesEnabled()=") + .append(isUploadRulesEnabled()).append(", isHandleNoAccessViaProxy()=") + .append(isHandleNoAccessViaProxy()).append(", getDefaultIrodsAuthScheme()=") + .append(getDefaultIrodsAuthScheme()).append(", getClass()=").append(getClass()).append(", hashCode()=") + .append(hashCode()).append(", toString()=").append(super.toString()).append("]"); return builder.toString(); } @@ -230,4 +233,13 @@ public boolean isHandleNoAccessViaProxy() { public void setHandleNoAccessViaProxy(boolean handleNoAccessViaProxy) { this.handleNoAccessViaProxy = handleNoAccessViaProxy; } + + @Override + public String getDefaultIrodsAuthScheme() { + return defaultIrodsAuthScheme; + } + + public void setDefaultIrodsAuthScheme(String defaultIrodsAuthScheme) { + this.defaultIrodsAuthScheme = defaultIrodsAuthScheme; + } } diff --git a/emc-metalnx-services/src/main/java/com/emc/metalnx/services/irods/CollectionServiceImpl.java b/emc-metalnx-services/src/main/java/com/emc/metalnx/services/irods/CollectionServiceImpl.java index 1b11eff..368d596 100755 --- a/emc-metalnx-services/src/main/java/com/emc/metalnx/services/irods/CollectionServiceImpl.java +++ b/emc-metalnx-services/src/main/java/com/emc/metalnx/services/irods/CollectionServiceImpl.java @@ -1,7 +1,5 @@ - /* Copyright (c) 2018, University of North Carolina at Chapel Hill */ - /* Copyright (c) 2015-2017, Dell EMC */ - - +/* Copyright (c) 2018, University of North Carolina at Chapel Hill */ +/* Copyright (c) 2015-2017, Dell EMC */ package com.emc.metalnx.services.irods; @@ -172,6 +170,68 @@ public boolean isDataObject(String path) throws DataGridConnectionRefusedExcepti return !isCollection(path); } + @Override + public boolean canUserAccessThisPath(String path) throws DataGridException { + logger.info("canUserAccessThisPath()"); + if (path == null || path.isEmpty()) { + throw new IllegalArgumentException("null or empty path"); + } + logger.info("path:{}", path); + CollectionAndDataObjectListAndSearchAO lister = irodsServices.getCollectionAndDataObjectListAndSearchAO(); + try { + lister.retrieveObjectStatForPath(path); + return true; + } catch (FileNotFoundException fnf) { + logger.warn("no access to file"); + return false; + } catch (JargonException e) { + logger.error("exception obtaining objStat", e); + throw new DataGridException(e); + } + } + + @Override + @SuppressWarnings("unchecked") + public DataProfile getCollectionDataProfileAsProxyAdmin(String path) + throws FileNotFoundException, DataGridException { + + logger.info("getCollectionDataProfileAsProxyAdmin()"); + IRODSAccount irodsAccount = irodsServices.getIrodsAdminAccount(); + + if (path == null) { + throw new IllegalArgumentException("null path"); + } + + logger.info("path:{}", path); + + DataProfilerSettings dataProfilerSettings = new DataProfilerSettings(); + dataProfilerSettings.setDetectMimeAndInfoType(true); + dataProfilerSettings.setRetrieveAcls(false); + dataProfilerSettings.setRetrieveMetadata(true); + dataProfilerSettings.setRetrieveReplicas(false); + dataProfilerSettings.setRetrieveShared(false); + dataProfilerSettings.setRetrieveStarred(false); + dataProfilerSettings.setRetrieveTickets(false); + + DataProfilerService dataProfilerService = dataProfilerFactory.instanceDataProfilerService(irodsAccount, + dataProfilerSettings); + + try { + @SuppressWarnings("rawtypes") + DataProfile dataProfile = dataProfilerService.retrieveDataProfile(path); + logger.info("------CollectionInfoController getTestCollectionInfo() ends !!"); + logger.info("data profile retrieved:{}", dataProfile); + return dataProfile; + } catch (FileNotFoundException fnf) { + logger.warn("file not found for path:{}", path); + throw fnf; + } catch (JargonException e) { + logger.error("Could not retrieve collection/dataobject from path: {}", path, e); + throw new DataGridException(e.getMessage()); + } + + } + @Override public List getSubCollectionsAndDataObjectsUnderPathThatMatchSearchTextPaginated( String parentPath, String searchText, int pageNum, int pageSize, int orderColumn, String orderDir, @@ -241,26 +301,6 @@ public List getSubCollectionsAndDataObjectsUnde return dataGridCollectionAndDataObjects; } - @Override - public boolean canUserAccessThisPath(String path) throws DataGridException { - logger.info("canUserAccessThisPath()"); - if (path == null || path.isEmpty()) { - throw new IllegalArgumentException("null or empty path"); - } - logger.info("path:{}", path); - CollectionAndDataObjectListAndSearchAO lister = irodsServices.getCollectionAndDataObjectListAndSearchAO(); - try { - lister.retrieveObjectStatForPath(path); - return true; - } catch (FileNotFoundException fnf) { - logger.warn("no access to file"); - return false; - } catch (JargonException e) { - logger.error("exception obtaining objStat", e); - throw new DataGridException(e); - } - } - @Override public String getPermissionsForPath(String path) throws DataGridConnectionRefusedException { @@ -500,6 +540,58 @@ public DataGridCollectionAndDataObject findByName(String path) throws FileNotFou return dataGridCollectionAndDataObject; } + @Override + public void modifyInheritance(String path, boolean inheritOption, boolean recursive) throws DataGridException { + logger.info("modifyInheritance()"); + if (path == null || path.isEmpty()) { + logger.error("null or empty path:{}"); + throw new IllegalArgumentException("null or empty path"); + } + + logger.info("path:{}", path); + logger.info("inheritOption:{}", inheritOption); + logger.info("recursive:{}", recursive); + + // if role is admin, use the admin option for this operation + boolean asAdmin = this.getIrodsServices().isActingAsAdmin(); + logger.info("acting as an admin"); + CollectionAO collectionAO = irodsServices.getCollectionAO(); + IRODSFileSystemAO irodsFileSystemAO = irodsServices.getIRODSFileSystemAO(); + + try { + + String zoneName = irodsFileSystemAO.getIRODSServerProperties().getRodsZone(); + + if (!asAdmin) { + logger.info("acting as an normal user"); + if (inheritOption) { + logger.debug("Setting inheritance option on {}", path); + collectionAO.setAccessPermissionInherit(zoneName, path, recursive); + } + // disable inheritance for this collection + else { + logger.debug("Removing inheritance setting on {}", path); + collectionAO.setAccessPermissionToNotInherit(zoneName, path, recursive); + } + } else { + logger.info("acting as a administrator"); + if (inheritOption) { + logger.debug("Setting inheritance option on {}", path); + collectionAO.setAccessPermissionInheritAsAdmin(zoneName, path, recursive); + } + // disable inheritance for this collection + else { + logger.debug("Removing inheritance setting on {}", path); + collectionAO.setAccessPermissionToNotInheritInAdminMode(zoneName, path, recursive); + } + + } + } catch (JargonException je) { + throw new DataGridException(je); + } + + } + @Override public boolean modifyCollectionAndDataObject(String previousPath, String newPath, boolean inheritOption) throws DataGridConnectionRefusedException { @@ -1424,7 +1516,8 @@ public void setFileOperationService(FileOperationService fileOperationService) { @SuppressWarnings("unchecked") @Override - public DataProfile getCollectionDataProfile(String path) throws FileNotFoundException , DataGridException { + public DataProfile getCollectionDataProfile(String path) + throws FileNotFoundException, DataGridException { IRODSAccount irodsAccount = irodsServices.getUserAO().getIRODSAccount(); logger.info("path:{}", path); @@ -1446,47 +1539,6 @@ public DataProfile getCollectionDataProfile(String path) thro } - @Override - @SuppressWarnings("unchecked") - public DataProfile getCollectionDataProfileAsProxyAdmin(String path) throws FileNotFoundException, DataGridException { - - logger.info("getCollectionDataProfileAsProxyAdmin()"); - IRODSAccount irodsAccount = irodsServices.getIrodsAdminAccount(); - - if (path == null) { - throw new IllegalArgumentException("null path"); - } - - logger.info("path:{}", path); - - DataProfilerSettings dataProfilerSettings = new DataProfilerSettings(); - dataProfilerSettings.setDetectMimeAndInfoType(true); - dataProfilerSettings.setRetrieveAcls(false); - dataProfilerSettings.setRetrieveMetadata(true); - dataProfilerSettings.setRetrieveReplicas(false); - dataProfilerSettings.setRetrieveShared(false); - dataProfilerSettings.setRetrieveStarred(false); - dataProfilerSettings.setRetrieveTickets(false); - - DataProfilerService dataProfilerService = dataProfilerFactory.instanceDataProfilerService(irodsAccount, - dataProfilerSettings); - - try { - @SuppressWarnings("rawtypes") - DataProfile dataProfile = dataProfilerService.retrieveDataProfile(path); - logger.info("------CollectionInfoController getTestCollectionInfo() ends !!"); - logger.info("data profile retrieved:{}", dataProfile); - return dataProfile; - } catch (FileNotFoundException fnf) { - logger.warn("file not found for path:{}", path); - throw fnf; - } catch (JargonException e) { - logger.error("Could not retrieve collection/dataobject from path: {}", path, e); - throw new DataGridException(e.getMessage()); - } - - } - public SpecificQueryProviderFactory getSpecificQueryProviderFactory() { return specificQueryProviderFactory; } diff --git a/emc-metalnx-services/src/main/java/com/emc/metalnx/services/irods/IRODSServicesImpl.java b/emc-metalnx-services/src/main/java/com/emc/metalnx/services/irods/IRODSServicesImpl.java index 153408b..25008f3 100644 --- a/emc-metalnx-services/src/main/java/com/emc/metalnx/services/irods/IRODSServicesImpl.java +++ b/emc-metalnx-services/src/main/java/com/emc/metalnx/services/irods/IRODSServicesImpl.java @@ -1,7 +1,5 @@ - /* Copyright (c) 2018, University of North Carolina at Chapel Hill */ - /* Copyright (c) 2015-2017, Dell EMC */ - - +/* Copyright (c) 2018, University of North Carolina at Chapel Hill */ +/* Copyright (c) 2015-2017, Dell EMC */ package com.emc.metalnx.services.irods; @@ -489,6 +487,11 @@ public IRODSAccessObjectFactory getIrodsAccessObjectFactory() { return irodsAccessObjectFactory; } + @Override + public boolean isActingAsAdmin() { + return this.getUserTokenDetails().getUser().isAdmin(); + } + public UserTokenDetails getUserTokenDetails() { return userTokenDetails; } diff --git a/irodsext-data-profiler/src/main/java/com/emc/metalnx/services/interfaces/CollectionService.java b/irodsext-data-profiler/src/main/java/com/emc/metalnx/services/interfaces/CollectionService.java index 5c176af..2044c3a 100755 --- a/irodsext-data-profiler/src/main/java/com/emc/metalnx/services/interfaces/CollectionService.java +++ b/irodsext-data-profiler/src/main/java/com/emc/metalnx/services/interfaces/CollectionService.java @@ -1,7 +1,5 @@ - /* Copyright (c) 2018, University of North Carolina at Chapel Hill */ - /* Copyright (c) 2015-2017, Dell EMC */ - - +/* Copyright (c) 2018, University of North Carolina at Chapel Hill */ +/* Copyright (c) 2015-2017, Dell EMC */ package com.emc.metalnx.services.interfaces; @@ -293,9 +291,14 @@ Set listWritePermissionsForPathAndGroup(String path, String groupName) * Update the inheritance options on collections * * @param toAdd + * {@code Map} with the inheritance paths and options to add * @param toRemove - * @return confirmation + * {@code Map} with the inheritance paths and options to remove + * @param zoneName + * {@code String} (blank if default} for which the operation is done + * @return confirmation {@code boolean} with the confirmation * @throws DataGridConnectionRefusedException + * {@link DataGridConnectionRefusedException} */ boolean updateInheritanceOptions(Map toAdd, Map toRemove, String zoneName) throws DataGridConnectionRefusedException; @@ -305,6 +308,7 @@ boolean updateInheritanceOptions(Map toAdd, Map toAdd, Map listWritePermissionsForPathAndGroupRecursive(String path, String groupName) throws DataGridConnectionRefusedException, JargonException; @@ -327,9 +335,10 @@ Set listWritePermissionsForPathAndGroupRecursive(String path, String gro * @param paths * array of strings that represent all paths that will be downloaded * @return Path to the compressed file, if any. Empty string, otherwise. - * @throws IOException * @throws DataGridException + * {@link DataGridException} * @throws JargonException + * {@link JargonException} */ String prepareFilesForDownload(String[] paths) throws IOException, DataGridException, JargonException; @@ -346,7 +355,9 @@ Set listWritePermissionsForPathAndGroupRecursive(String path, String gro * @throws DataGridException * {@link DataGridException} * @throws ZipServiceException + * {@link ZipServiceException} * @throws JargonException + * {@link JargonException} * */ String prepareFilesForDownload(List sourcePaths) @@ -358,7 +369,9 @@ String prepareFilesForDownload(List sourcePaths) * @param collPath * @return the boolean * @throws DataGridConnectionRefusedException + * {@link DataGridConnectionRefusedException} * @throws JargonException + * {@link JargonException} */ boolean getInheritanceOptionForCollection(String collPath) throws DataGridConnectionRefusedException, JargonException; @@ -370,6 +383,7 @@ boolean getInheritanceOptionForCollection(String collPath) * path to the collection/object * @return int with the replica number 0, if path does not exist * @throws DataGridConnectionRefusedException + * {@link DataGridConnectionRefusedException} */ int getReplicationNumber(String path) throws DataGridConnectionRefusedException; @@ -380,6 +394,7 @@ boolean getInheritanceOptionForCollection(String collPath) * path to the collection/object in the grid * @return String with the checksum * @throws DataGridConnectionRefusedException + * {@link DataGridConnectionRefusedException} */ String getChecksum(String path) throws DataGridConnectionRefusedException; @@ -400,7 +415,7 @@ List mapListingEntryToDataGridCollectionAndData * * @param entry * CollectionAndDataObjectListingEntry objects to map - * @return instance of DataGridCollectionAndDataObject + * @return instance of {@link DataGridCollectionAndDataObject} */ DataGridCollectionAndDataObject mapListingEntryToDataGridCollectionAndDataObject( CollectionAndDataObjectListingEntry entry); @@ -408,7 +423,7 @@ DataGridCollectionAndDataObject mapListingEntryToDataGridCollectionAndDataObject /** * Gets the public directory * - * @return string with the path to the the public directory + * @return {@code Stringa] with the path to the the public directory */ String getHomeDirectyForPublic(); @@ -416,8 +431,10 @@ DataGridCollectionAndDataObject mapListingEntryToDataGridCollectionAndDataObject * Retrieve only the collections under a parent collection * * @param parent - * @return + * {@code String} with the parent path + * @return {@code List} of {@link DataGridCollectionAndDataObject} * @throws DataGridConnectionRefusedException + * {@link DataGridConnectionRefusedException} */ List getSubCollectionsUnderPath(String parent) throws DataGridConnectionRefusedException; @@ -426,8 +443,8 @@ List getSubCollectionsUnderPath(String parent) * Get trash path related to the current path * * @param path - * {@code String} with the iRODS path - * @return corresponding trash for given path + * {@code String} with the path + * @return correspondent trash for given path */ String getTrashForPath(String path); @@ -441,20 +458,26 @@ List getSubCollectionsUnderPath(String parent) * @return {@link DataProfile} * @throws DataGridException * {@link DataGridException} - * @throws FileNotFoundException + * @throws FileNotFoundException + * {@link FileNotFoundException} */ - DataProfile getCollectionDataProfile(String path) throws FileNotFoundException, DataGridException; + DataProfile getCollectionDataProfile(String path) + throws DataGridException, FileNotFoundException; /** - * Retrieve a data profile for the path + * Update the collection inheritance value * * @param path - * {@code String} with the path - * @return {@link DataProfile} + * {@code String} with the collection path + * @param inheritOption + * {@code boolean} with the inheritance setting + * @param recursive + * {@code boolean} indicating whether to apply the setting + * recursively * @throws DataGridException * {@link DataGridException} */ - DataProfile getCollectionDataProfileAsProxyAdmin(String path) throws FileNotFoundException , DataGridException; + void modifyInheritance(String path, boolean inheritOption, boolean recursive) throws DataGridException; /** * Handy method probes user access to a path @@ -467,4 +490,17 @@ List getSubCollectionsUnderPath(String parent) */ boolean canUserAccessThisPath(String path) throws DataGridException; + /** + * Retrieve a data profile for the path using the admin account to serve as a + * metadata only proxy + * + * @param path + * {@code String} with the path + * @return {@link DataProfile} + * @throws DataGridException + * {@link DataGridException} + */ + DataProfile getCollectionDataProfileAsProxyAdmin(String path) + throws FileNotFoundException, DataGridException; + } diff --git a/irodsext-data-profiler/src/main/java/com/emc/metalnx/services/interfaces/ConfigService.java b/irodsext-data-profiler/src/main/java/com/emc/metalnx/services/interfaces/ConfigService.java index cb9f2ba..3942e7b 100755 --- a/irodsext-data-profiler/src/main/java/com/emc/metalnx/services/interfaces/ConfigService.java +++ b/irodsext-data-profiler/src/main/java/com/emc/metalnx/services/interfaces/ConfigService.java @@ -1,12 +1,12 @@ - /* Copyright (c) 2018, University of North Carolina at Chapel Hill */ - /* Copyright (c) 2015-2017, Dell EMC */ - - +/* Copyright (c) 2018, University of North Carolina at Chapel Hill */ +/* Copyright (c) 2015-2017, Dell EMC */ package com.emc.metalnx.services.interfaces; import java.util.List; +import org.irods.jargon.core.connection.AuthScheme; + import com.emc.metalnx.services.configuration.GlobalConfig; /** @@ -124,4 +124,12 @@ public interface ConfigService { * applied based on file type */ boolean isUploadRulesEnabled(); + + /** + * Default auth scheme used at login time by the user on the login form + * + * @return {@code String} with the stringified representation of the jargon + * {@link AuthScheme} + */ + String getDefaultIrodsAuthScheme(); } diff --git a/irodsext-data-profiler/src/main/java/com/emc/metalnx/services/interfaces/IRODSServices.java b/irodsext-data-profiler/src/main/java/com/emc/metalnx/services/interfaces/IRODSServices.java index cdee010..9d4b68a 100755 --- a/irodsext-data-profiler/src/main/java/com/emc/metalnx/services/interfaces/IRODSServices.java +++ b/irodsext-data-profiler/src/main/java/com/emc/metalnx/services/interfaces/IRODSServices.java @@ -1,7 +1,5 @@ - /* Copyright (c) 2018, University of North Carolina at Chapel Hill */ - /* Copyright (c) 2015-2017, Dell EMC */ - - +/* Copyright (c) 2018, University of North Carolina at Chapel Hill */ +/* Copyright (c) 2015-2017, Dell EMC */ package com.emc.metalnx.services.interfaces; @@ -260,4 +258,12 @@ CollectionAndDataObjectListAndSearchAO getCollectionAndDataObjectListAndSearchAO */ IRODSAccount getIrodsAdminAccount() throws DataGridException; + /** + * Handy method to determine if the logged in user is acting in the role of + * administrator + * + * @return {@code boolean} indicating {@code true} if user is an admin + */ + boolean isActingAsAdmin(); + }