Conditions - tsgrp/HPI GitHub Wiki

Conditions are used as part of the OpenContent action framework. A condition is evaluated against a repository object to determine if the repository object and user context satisfies some state. For instance, the "canwrite" condition will check to see if the currently logged in user has WRITE repository permission on that object.

Conditions are primarily used as second-class citizens in the OpenContent action framework, each being a part of each configured action. For instance, the "Add Document" OC action uses the required "canwrite" condition to determine if the currently logged in user is allowed to upload a document to a specific folder. Conditions can also be non-required, which means that an action is allowed to be executed even if the condition is evaluated to be invalid. Non-required conditions can be useful to an OC client (such as HPI) to have additional information about the action. For instance, the View/Edit Properties HPI action has a non-required condition "canwrite" and a required condition "canread". If the "canwrite" condition is valid, the HPI action allows the user to change the object's metadata, but if the "canwrite" condition is invalid, the HPI action does not allow the user to change metadata.

Due to the increasing value of the action framework, Conditions have been granted first-class citizenship, accessible from OC without a parent action. In HPI refer to condition.js to see how to evaluate one or many conditions for a given repository object in any HPI module.

You can see what conditions are available in your HPI/OC installation by navigating to hpi/admin/ActionInfo.

⚠️ **GitHub.com Fallback** ⚠️