Search in sources :

Example 1 with RemoteAccess

use of org.jbei.ice.lib.access.RemoteAccess in project ice by JBEI.

the class PermissionResource method addRemoteAccess.

/**
     * Add a remote access from a partner in the web of registries
     */
@POST
@Path("/remote")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response addRemoteAccess(RemoteAccessPermission accessPermission) {
    RegistryPartner partner = requireWebPartner();
    RemoteAccess remoteAccess = new RemoteAccess();
    return super.respond(remoteAccess.add(partner, accessPermission));
}
Also used : RegistryPartner(org.jbei.ice.lib.dto.web.RegistryPartner) RemoteAccess(org.jbei.ice.lib.access.RemoteAccess) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces)

Example 2 with RemoteAccess

use of org.jbei.ice.lib.access.RemoteAccess in project ice by JBEI.

the class PermissionResource method addRemoteAccess.

/**
 * Add a remote access from a partner in the web of registries
 */
@POST
@Path("/remote")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response addRemoteAccess(AccessPermission accessPermission) {
    RegistryPartner partner = requireWebPartner();
    log(partner.getUrl(), "adding remote permission");
    RemoteAccess remoteAccess = new RemoteAccess();
    return super.respond(remoteAccess.add(partner, accessPermission));
}
Also used : RegistryPartner(org.jbei.ice.lib.dto.web.RegistryPartner) RemoteAccess(org.jbei.ice.lib.access.RemoteAccess) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces)

Example 3 with RemoteAccess

use of org.jbei.ice.lib.access.RemoteAccess in project ice by JBEI.

the class PartnerResource method getRemoteUser.

@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("{id}/users/{email}")
public Response getRemoteUser(@PathParam("id") final long remoteId, @PathParam("email") final String email) {
    requireUserId();
    RemoteAccess remoteAccess = new RemoteAccess();
    AccountTransfer accountTransfer = remoteAccess.getRemoteUser(remoteId, email);
    return super.respond(accountTransfer);
}
Also used : RemoteAccess(org.jbei.ice.lib.access.RemoteAccess) AccountTransfer(org.jbei.ice.lib.account.AccountTransfer)

Aggregations

RemoteAccess (org.jbei.ice.lib.access.RemoteAccess)3 Consumes (javax.ws.rs.Consumes)2 POST (javax.ws.rs.POST)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 RegistryPartner (org.jbei.ice.lib.dto.web.RegistryPartner)2 AccountTransfer (org.jbei.ice.lib.account.AccountTransfer)1