Can Edit Row list plugin

Dec 1, 2017
Can Edit Row list plugin
  • This plug-in provides a fine grained control over which records can be edited.

    The list's Access->edit records option takes precedence over this plugin. That is to say that if you are logged in as a registered user, and the list's delete records option is set to Special, then no records can be edited, regardless of any match that might be made with this plugin. In other words, this plugin can only be used to deny access to a row which the built in list ACL's would usually allow. It cannot permit edit access, if the normal list ACL's do not allow permission.

    If more than one can edit plugin is used, and any one of the plugins returns false, then the row will not be editable.


    NOTE the above precedence was change on 12/1/2017. The plugin now takes precedence over the list's normal group/user ACLs. If the plugin returns true or false, this overrides the list's ACLs. If the plugin returns null, then the list ACL's are used. If more than one plugin returns a result, 'false' takes precedence.

    caneditrow-options.png

    • Access - Which Joomla User 'Access level' will this plug-in be applied to
    • Element - The element whose data needs to make the value specified in the 'value' field.
    • Use Raw - Should we compare the element's raw data or the visible data (e.g. if using a user element, do we compare against the raw value '62' or the display value of 'Admin')
    • Value - The value to compare against. If the element's value matches this then the row IS editable
    caneditrow-example.png

    caneditrow-advanced.png
    • PHP (eval) - A PHP statement which needs to return the value to match against the element's data. Anything entered here takes precedence over the 'value' field. usual placeholders can be used, like {tablename___elementname}, {$my->id}, etc.
    Code (Text):

    /**
     * If status is 1, allow edit.  If status is 2, don't allow edit.  If status is 3, punt and let normal ACLs decide
     */
    switch ('{tablename___status_raw}') {
       case '1':
          return true;
       case '2':
          return false;
       case '3':
          return null;
    }
     
  • Loading...