Skip to content
Snippets Groups Projects
Commit aaaafe2f authored by felmer's avatar felmer
Browse files

LMS-761 Authorization annotations added to IETLLIMSService. IETLIMSService regression test added

SVN: 9928
parent d8b5f6d2
No related branches found
No related tags found
No related merge requests found
......@@ -20,8 +20,10 @@ import org.springframework.transaction.annotation.Transactional;
import ch.systemsx.cisd.common.exceptions.UserFailureException;
import ch.systemsx.cisd.openbis.generic.shared.authorization.ISessionProvider;
import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.AuthorizationGuard;
import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RoleSet;
import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RolesAllowed;
import ch.systemsx.cisd.openbis.generic.shared.authorization.predicate.SampleOwnerIdentifierPredicate;
import ch.systemsx.cisd.openbis.generic.shared.dto.DatabaseInstancePE;
import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE;
import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalData;
......@@ -40,6 +42,7 @@ public interface IETLLIMSService extends IWebService, IDataStoreInfoProvider, IS
* Returns the home database instance.
*/
@Transactional(readOnly = true)
@RolesAllowed(RoleSet.ETL_SERVER)
public DatabaseInstancePE getHomeDatabaseInstance();
/**
......@@ -52,6 +55,7 @@ public interface IETLLIMSService extends IWebService, IDataStoreInfoProvider, IS
@Transactional(readOnly = true)
@RolesAllowed(RoleSet.ETL_SERVER)
public ExperimentPE tryToGetBaseExperiment(final String sessionToken,
@AuthorizationGuard(guardClass = SampleOwnerIdentifierPredicate.class)
final SampleIdentifier sampleIdentifier) throws UserFailureException;
/**
......@@ -66,6 +70,7 @@ public interface IETLLIMSService extends IWebService, IDataStoreInfoProvider, IS
@Transactional(readOnly = true)
@RolesAllowed(RoleSet.ETL_SERVER)
public SamplePropertyPE[] tryToGetPropertiesOfTopSampleRegisteredFor(final String sessionToken,
@AuthorizationGuard(guardClass = SampleOwnerIdentifierPredicate.class)
final SampleIdentifier sampleIdentifier) throws UserFailureException;
/**
......@@ -82,9 +87,10 @@ public interface IETLLIMSService extends IWebService, IDataStoreInfoProvider, IS
*/
@Transactional
@RolesAllowed(RoleSet.ETL_SERVER)
public void registerDataSet(final String sessionToken, final SampleIdentifier sampleIdentifier,
final String procedureTypeCode, final ExternalData externalData)
throws UserFailureException;
public void registerDataSet(final String sessionToken,
@AuthorizationGuard(guardClass = SampleOwnerIdentifierPredicate.class)
final SampleIdentifier sampleIdentifier, final String procedureTypeCode,
final ExternalData externalData) throws UserFailureException;
/**
* Creates and returns a unique code for a new data set.
......
/*
* Copyright 2007 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.systemsx.cisd.openbis.generic.shared;
import org.springframework.transaction.annotation.Transactional;
import ch.systemsx.cisd.common.exceptions.UserFailureException;
import ch.systemsx.cisd.openbis.generic.shared.authorization.ISessionProvider;
import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.AuthorizationGuard;
import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RoleSet;
import ch.systemsx.cisd.openbis.generic.shared.authorization.annotation.RolesAllowed;
import ch.systemsx.cisd.openbis.generic.shared.authorization.predicate.SampleOwnerIdentifierPredicate;
import ch.systemsx.cisd.openbis.generic.shared.dto.DatabaseInstancePE;
import ch.systemsx.cisd.openbis.generic.shared.dto.ExperimentPE;
import ch.systemsx.cisd.openbis.generic.shared.dto.ExternalData;
import ch.systemsx.cisd.openbis.generic.shared.dto.SamplePropertyPE;
import ch.systemsx.cisd.openbis.generic.shared.dto.identifier.SampleIdentifier;
public interface IETLLIMSService extends IWebService, IDataStoreInfoProvider, ISessionProvider
{
@Transactional(readOnly = true)
@RolesAllowed(RoleSet.ETL_SERVER)
public DatabaseInstancePE getHomeDatabaseInstance();
@Transactional(readOnly = true)
@RolesAllowed(RoleSet.ETL_SERVER)
public ExperimentPE tryToGetBaseExperiment(final String sessionToken,
@AuthorizationGuard(guardClass = SampleOwnerIdentifierPredicate.class)
final SampleIdentifier sampleIdentifier) throws UserFailureException;
@Transactional(readOnly = true)
@RolesAllowed(RoleSet.ETL_SERVER)
public SamplePropertyPE[] tryToGetPropertiesOfTopSampleRegisteredFor(final String sessionToken,
@AuthorizationGuard(guardClass = SampleOwnerIdentifierPredicate.class)
final SampleIdentifier sampleIdentifier) throws UserFailureException;
@Transactional
@RolesAllowed(RoleSet.ETL_SERVER)
public void registerDataSet(final String sessionToken,
@AuthorizationGuard(guardClass = SampleOwnerIdentifierPredicate.class)
final SampleIdentifier sampleIdentifier, final String procedureTypeCode,
final ExternalData externalData) throws UserFailureException;
@Transactional
@RolesAllowed(RoleSet.ETL_SERVER)
public String createDataSetCode(final String sessionToken) throws UserFailureException;
}
\ No newline at end of file
......@@ -37,4 +37,11 @@ public class ServerInterfaceRegressionTest extends RegressionTestCase
assertMandatoryMethodAnnotations(IPluginCommonServer.class);
assertNormalizedSourceFilesAreEqual(IPluginCommonServer.class);
}
@Test
public void testIETLLIMSService()
{
assertMandatoryMethodAnnotations(IETLLIMSService.class);
assertNormalizedSourceFilesAreEqual(IETLLIMSService.class);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment