use of org.apache.syncope.common.lib.to.DynRealmTO in project syncope by apache.
the class DynRealmServiceImpl method create.
@Override
public Response create(final DynRealmTO roleTO) {
DynRealmTO created = logic.create(roleTO);
URI location = uriInfo.getAbsolutePathBuilder().path(created.getKey()).build();
return Response.created(location).header(RESTHeaders.RESOURCE_KEY, created.getKey()).build();
}
use of org.apache.syncope.common.lib.to.DynRealmTO in project syncope by apache.
the class DynRealmLogic method delete.
@PreAuthorize("hasRole('" + StandardEntitlement.DYNREALM_DELETE + "')")
public DynRealmTO delete(final String key) {
DynRealm dynRealm = dynRealmDAO.find(key);
if (dynRealm == null) {
LOG.error("Could not find dynamic realm '" + key + "'");
throw new NotFoundException(key);
}
DynRealmTO deleted = binder.getDynRealmTO(dynRealm);
dynRealmDAO.delete(key);
return deleted;
}
Aggregations