Examples of Consent


Examples of org.apache.isis.core.metamodel.consent.Consent

    public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException {

        final ObjectAdapter onAdapter = performContext.getOnAdapter();
        final OneToOneAssociation otoa = (OneToOneAssociation) performContext.getObjectMember();

        final Consent validityConsent = otoa.isAssociationValid(onAdapter, null);

        if (!getAssertion().satisfiedBy(validityConsent)) {
            final CellBinding thatBinding = performContext.getPeer().getThatItBinding();
            throw ScenarioBoundValueException.current(thatBinding, getAssertion().getReason(validityConsent));
        }
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Consent

        // obtain existing as 'context' (used if this is a parsed @Value)
        final ObjectAdapter contextAdapter = otoa.get(onAdapter);

        // validate parameter
        final ObjectAdapter toSetAdapter = performContext.getPeer().getAdapter(contextAdapter, otoa.getSpecification(), arg0Binding, arg0Cell);
        final Consent validConsent = otoa.isAssociationValid(onAdapter, toSetAdapter);
        if (validConsent.isVetoed()) {
            throw ScenarioBoundValueException.current(arg0Binding, validConsent.getReason());
        }

        setterFacet.setProperty(onAdapter, toSetAdapter);

    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Consent

        // lookup arguments
        final ObjectAdapter[] proposedArguments = performContext.getPeer().getAdapters(onAdapter, nakedObjectAction, onMemberBinding, argumentCells);

        // validate arguments
        final Consent argSetValid = nakedObjectAction.isProposedArgumentSetValid(onAdapter, proposedArguments);
        if (argSetValid.isVetoed()) {
            throw ScenarioBoundValueException.current(onMemberBinding, argSetValid.getReason());
        }

        // execute
        return null;
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Consent

            // lookup arguments
            proposedArguments = performContext.getPeer().getAdapters(onAdapter, objectAction, onMemberBinding, argumentCells);

            // validate arguments
            final Consent argSetValid = objectAction.isProposedArgumentSetValid(onAdapter, proposedArguments);
            if (argSetValid.isVetoed()) {
                throw ScenarioBoundValueException.current(onMemberBinding, argSetValid.getReason());
            }
        } else {
            proposedArguments = new ObjectAdapter[] { onAdapter };
        }
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Consent

    private void addProperties(final ObjectAdapter objectAdapter, final JsonRepresentation members, final List<ObjectAssociation> associations) {
        final LinkFollowSpecs linkFollower = getLinkFollowSpecs().follow("members");
        for (final ObjectAssociation assoc : associations) {

            if (mode.checkVisibility()) {
                final Consent visibility = assoc.isVisible(getRendererContext().getAuthenticationSession(), objectAdapter, rendererContext.getWhere());
                if (!visibility.isAllowed()) {
                    continue;
                }
            }
            if (!(assoc instanceof OneToOneAssociation)) {
                continue;
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Consent

    private void addCollections(final ObjectAdapter objectAdapter, final JsonRepresentation members, final List<ObjectAssociation> associations) {
        final LinkFollowSpecs linkFollower = getLinkFollowSpecs().follow("members");
        for (final ObjectAssociation assoc : associations) {

            if (mode.checkVisibility()) {
                final Consent visibility = assoc.isVisible(getRendererContext().getAuthenticationSession(), objectAdapter, rendererContext.getWhere());
                if (!visibility.isAllowed()) {
                    continue;
                }
            }

            if (!(assoc instanceof OneToManyAssociation)) {
View Full Code Here

Examples of org.apache.isis.core.metamodel.consent.Consent

        }
    }

    private void addActions(final ObjectAdapter objectAdapter, final List<ObjectAction> actions, final JsonRepresentation members) {
        for (final ObjectAction action : actions) {
            final Consent visibility = action.isVisible(getRendererContext().getAuthenticationSession(), objectAdapter, rendererContext.getWhere());
            if (!visibility.isAllowed()) {
                continue;
            }
            final LinkFollowSpecs linkFollowSpecs = getLinkFollowSpecs().follow("members["+action.getId()+"]");
           
            final ObjectActionReprRenderer renderer = new ObjectActionReprRenderer(getRendererContext(), linkFollowSpecs, action.getId(), JsonRepresentation.newMap());
View Full Code Here

Examples of org.apache.isis.noa.reflect.Consent

     * then {@link #isParameterSetValidImperatively(ObjectAdapterReference, ObjectAdapter[])}, as per the
     * contract in the {@link ObjectAction implemented interface}.
     */
  public Consent isParameterSetValid(final ObjectAdapterReference object,
      final ObjectAdapter[] parameters) {
      Consent consentDeclaratively = isParameterSetValidDeclaratively(object, parameters);
        if (consentDeclaratively.isVetoed()) {
            return consentDeclaratively;
        }
    return isParameterSetValidImperatively(object, parameters);
  }
View Full Code Here

Examples of org.apache.isis.noa.reflect.Consent

    public Consent isUsable(final ObjectAdapterReference target) {
    return peer.isUsable(target);
  }

    public Consent isUsable() {
        Consent usableDeclaratively = isUsableDeclaratively();
        if (usableDeclaratively.isVetoed()) {
            return usableDeclaratively;
        }
        return isUsableForSession();
    }
View Full Code Here

Examples of org.apache.isis.noa.reflect.Consent

    public String getDescription() {
        return null;
    }

    public Consent isUsable() {
        Consent usableDeclaratively = isUsableDeclaratively();
        if (usableDeclaratively.isVetoed()) {
            return usableDeclaratively;
        }
        return isUsableForSession();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.