Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-12650

{{permission}} macro to allow the content to execute based on whether the user has the permission to do so

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Rendering, Security
    • Labels:
      None
    • Difficulty:
      Trivial
    • Similar issues:

      Description

      Usage example:

      {{permission types="view,edit,admin"}}
      something
      {{/permission}}
      

      Features:

      • Ability to specify one or several permissions

      For example the following that we currently have:

      {{velocity wiki="true"}}
      #if($hasEdit) You can use the [[Sandbox space>>Sandbox.WebHome]] to try out your wiki's features. #end
      {{/velocity}}
      

      would get replaced by:

      {{permission types="edit"}}
      You can use the [[Sandbox space>>Sandbox.WebHome]] to try out your wiki's features.
      {{/permission}}
      

      The idea is to make it nicer and cleaner for simple users to use advanced features (including the ability to add this macro from the WYSIWYG editor).

      Note: We should not add too many options since we don't want to replace the scripting way. The idea is just to find the most common use cases and provide an easy way for simple users to use it.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vmassol Vincent Massol
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Date of First Response: