Search in sources :

Example 6 with DynRealmTO

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();
}
Also used : DynRealmTO(org.apache.syncope.common.lib.to.DynRealmTO) URI(java.net.URI)

Example 7 with DynRealmTO

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;
}
Also used : NotFoundException(org.apache.syncope.core.persistence.api.dao.NotFoundException) DynRealmTO(org.apache.syncope.common.lib.to.DynRealmTO) DynRealm(org.apache.syncope.core.persistence.api.entity.DynRealm) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize)

Aggregations

DynRealmTO (org.apache.syncope.common.lib.to.DynRealmTO)7 SyncopeClientException (org.apache.syncope.common.lib.SyncopeClientException)3 Response (javax.ws.rs.core.Response)2 UserTO (org.apache.syncope.common.lib.to.UserTO)2 StandardEntitlement (org.apache.syncope.common.lib.types.StandardEntitlement)2 AnyQuery (org.apache.syncope.common.rest.api.beans.AnyQuery)2 DynRealmService (org.apache.syncope.common.rest.api.service.DynRealmService)2 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 AlignmentBehavior (de.agilecoders.wicket.core.markup.html.bootstrap.behavior.AlignmentBehavior)1 BootstrapAjaxLink (de.agilecoders.wicket.core.markup.html.bootstrap.button.BootstrapAjaxLink)1 ButtonList (de.agilecoders.wicket.core.markup.html.bootstrap.button.ButtonList)1 Buttons (de.agilecoders.wicket.core.markup.html.bootstrap.button.Buttons)1 DropDownButton (de.agilecoders.wicket.core.markup.html.bootstrap.button.dropdown.DropDownButton)1 GlyphIconType (de.agilecoders.wicket.core.markup.html.bootstrap.image.GlyphIconType)1 IconType (de.agilecoders.wicket.core.markup.html.bootstrap.image.IconType)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 Comparator (java.util.Comparator)1