Changeset 4207 for DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/UserResource.java
- Timestamp:
- 12/19/13 14:36:04 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/UserResource.java
r4010 r4207 23 23 import eu.dasish.annotation.schema.ObjectFactory; 24 24 import eu.dasish.annotation.schema.User; 25 import java.io.IOException; 25 26 import java.sql.SQLException; 26 27 import java.util.UUID; … … 38 39 import javax.ws.rs.core.UriInfo; 39 40 import javax.xml.bind.JAXBElement; 41 import javax.xml.parsers.ParserConfigurationException; 40 42 import org.springframework.beans.factory.annotation.Autowired; 41 43 import org.springframework.security.access.annotation.Secured; 42 44 import org.springframework.stereotype.Component; 45 import org.springframework.transaction.annotation.Transactional; 43 46 44 47 /** … … 48 51 @Component 49 52 @Path("/users") 53 @Transactional(rollbackFor={Exception.class, SQLException.class, IOException.class, ParserConfigurationException.class}) 50 54 public class UserResource { 51 55 @Autowired … … 66 70 @Produces(MediaType.TEXT_XML) 67 71 @Path("{userid: " + BackendConstants.regExpIdentifier + "}") 68 @Secured("ROLE_USER") 72 @Secured("ROLE_USER") 73 @Transactional(readOnly=true) 69 74 public JAXBElement<User> getUser(@PathParam("userid") String ExternalIdentifier) throws SQLException { 70 75 dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString()); … … 77 82 @Produces(MediaType.TEXT_XML) 78 83 @Path("/info") 79 @Secured("ROLE_USER") 84 @Secured("ROLE_USER") 85 @Transactional(readOnly=true) 80 86 public JAXBElement<User> getUserByInfo(@QueryParam("email") String email) throws SQLException { 81 87 dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString()); … … 87 93 @Produces(MediaType.TEXT_XML) 88 94 @Path("{userid: " + BackendConstants.regExpIdentifier + "}/current") 89 @Secured("ROLE_USER") 95 @Secured("ROLE_USER") 96 @Transactional(readOnly=true) 90 97 public JAXBElement<CurrentUserInfo> getCurrentUserInfo(@PathParam("userid") String ExternalIdentifier){ 91 98 dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString());
Note: See TracChangeset
for help on using the changeset viewer.