Restrict (element)

From JRapid

(Redirected from Restrict)
Jump to: navigation, search

restrict is an element.



The "restrict" element is used to indicate the necessary user privileges to access a page. As a consequence, it is useful only when the application defines users, roles and privileges.

If defined inside an entity, the restriction will we applied only to its listings and forms. If defined inside a panel, the restriction will be applied only to that panel. If defined inside the <config> element, it will be applied to all HTML pages of the application.


     authentication = "basic"
  • authentication: (optional). If set to "basic" then the Basic Access Authentication method will be used.



      <restrict authentication="basic"> 
         <allow privilege="ADMIN" />
         <user name="nick" password="123" privileges="ADMIN" /> 
   <enumset name="Privileges" privileges="privileges"> 
      <enum value="ADMIN">ADMIN</enum> 
      <enum value="ANONYMOUS">ANONYMOUS</enum> 
  • 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">
            <allow action="SAVE" privilege="CS"/>
            <allow action="READ" privilege="ANONYMOUS"/>
            <allow action="LIST" privilege="ANONYMOUS"/>
            <allow action="REMOVE" privilege="ANONYMOUS"/>

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>

See also

Personal tools