use of ca.corefacility.bioinformatics.irida.security.ProjectSynchronizationAuthenticationToken in project irida by phac-nml.
the class ProjectOwnerPermissionTest method testRemoteProject.
@Test
public void testRemoteProject() {
project.setRemoteStatus(new RemoteStatus("http://somewhere", null));
Authentication authentication = new ProjectSynchronizationAuthenticationToken(user);
boolean customPermissionAllowed = permission.customPermissionAllowed(authentication, project);
assertTrue("user should be able to read project", customPermissionAllowed);
}
use of ca.corefacility.bioinformatics.irida.security.ProjectSynchronizationAuthenticationToken in project irida by phac-nml.
the class ProjectSynchronizationService method setAuthentication.
/**
* Set the given user's authentication in the SecurityContextHolder
*
* @param userAuthentication
* The {@link User} to set in the context holder
*/
private void setAuthentication(User user) {
ProjectSynchronizationAuthenticationToken userAuthentication = new ProjectSynchronizationAuthenticationToken(user);
SecurityContext context = SecurityContextHolder.createEmptyContext();
context.setAuthentication(userAuthentication);
SecurityContextHolder.setContext(context);
}
Aggregations