Allow (element)

From JRapid

(Redirected from Allow)
Jump to: navigation, search

The <allow> element is defined inside the <restrict> element to register a user privilege which will be allowed to execute an associated action (like read, remove, etc).

Usage

<restrict>
   ...
   <allow action="SAVE|ADD|LIST|REMOVE" privilege="PRIVILIGE_NAME"/>
   <allow ... />
   ...
</restrict>
  • action: the name of the action
  • privilege: the name of the associated privilege defined in the "Priviliges" enumset

Example

  • Adding a "SAVE" restriction to a entity:

A company can be saved only by users which have the "CS" privilege.

<entity label="Company" name="Company">
        <restrict>
            <allow action="SAVE" privilege="CS"/>
            <allow action="READ" privilege="ANONYMOUS"/>
            <allow action="LIST" privilege="ANONYMOUS"/>
            <allow action="REMOVE" privilege="ANONYMOUS"/>
        </restrict>
        ...
</entity>

The privileges enumset:

<enumset name="Privileges" privileges="privileges">
        <enum value="CS">companySave</enum>
        <enum value="CR">companyRead</enum>
        <enum value="CL">companyList</enum>
        <enum value="CRR">companyRemove</enum>
        <enum value="US">userSave</enum>
        <enum value="UR">userRead</enum>
        <enum value="UL">userList</enum>
        <enum value="URR">userRemove</enum>
</enumset>

See also

Personal tools