Expression


| Value | Extent | Reference | Property |

Expression

HiLang expressions include all the normal arithmetic operations (“+” also applies to strings), brackets for ordering and conditional expressions using C/C++/C# notation. Functions have a reference to the function name and several parameter references to other members within the element.

Access.RBAC.Permission is an example that incldues

  • Expression used for a value (Valid) that is evaluated before the element is bound to Hiperspace
  • Expression using %function (unary, approved, Access.RBAC.Functions.Approved, Boolean); external function to evaluate a flag used filter Approved access in a Horizon filter
  • Expression used for an extension propery (not stored with value) to implement CanUpdate and CanDelete constriants with Horizon filter
  • Expression used to provide additional information properties
segment Access.RBAC.Permission : Versioned, Access.RBAC.Permissioned 
(
    " Identify all the resource item. "
    Item        : Access.RBAC.Resource,

    " The permission being granted create, update, delete. "
    Right       : Access.RBAC.PermissionType
)
{
    " The set of roles that have approve this permission. "
    Approval    : Set<Ref<Access.RBAC.Group>>,

    " The set of roles that are required to approve this permission before it is used. "
    Required    = Item.Approvers,

    " Flag for Horizon conditions to hide unapproved permission requests. "
    Approved    = approved (Approval, Required),

    " Validation criteria to implement standard constraint rules. "
    Valid       = owner = null || 
                  Item = null ||
                  CanUpdate = false ||
                  CanDelete = false
                  ? false : true
}
[
    Authorised  = authorised (Author, Right, Subject),

    " Property that applies a security check to see if the user can update this permission through user, group or role permission"
    CanUpdate   = authorised (Author, Access.RBAC.PermissionType.Update, TypeName),

    " Property that applies a security check to see if the user can delete this permission through user, group or role permission"
    CanDelete   = Deleted = false || authorised (Author, Access.RBAC.PermissionType.Delete, TypeName) = true ? true : false,

    " Diagnostic error message for when the validation fails. "
    ErrorMsg    = (owner = null ? "Inalid owner, " : "") +
                  (Item = null ? "Invalid item, " : "") +
                  (CanUpdate = false ? "Can not update, " : "") +
                  (CanDelete = false ? "Can not delete, " : "")
]
;

Boolean Expression

Conditional expressions can include range, equality and Boolean AND (&&) and OR (||)

Copyright © Cepheis 2024