Dashboard > Atlassian Plugins > ... > Macros > show-to
  Atlassian Plugins Log In | Sign Up   View a printable version of the current page.  
  show-to

Added by David Peterson , last edited by David Peterson on May 07, 2008  (view change) show comment
Labels: 

{show-to}

Plugin: Visibility Plugin

This will only show its contents to a user that matches the users, groups or space-viewability specifications listed.

Usage

{show-to:users=[user list]|groups=[group list]|spaces=[space list]}
Hidden content.
{show-to}

Parameters

Name Required Default Description
user(s)
The user(s) to match. E.g. 'bob,marley' will match both bob and marley. May also be the following special usernames:
  • @anonymous - No user is currently logged in
  • @authenticated - Any authenticated user is logged in.
  • @self - The current user.
group(s)
The group(s) to match. E.g. 'confluence-users' will match all logged in users in that group.
space(s)
The space(s) which, if the user has 'view' access, will match. The type of permission the user has to the space can also be specified by putting a ':' followed by the permission type after the space name:
  • view - (default) The user can view the space.
  • edit - The user can edit pages.
  • admin - The user can administer the space.
  • news - The user can post a blog entry.
    Eg. space=MYSPACE,@self:edit requires MYSPACE view access or edit access to the current space (@self).
trim
true
If false, the content will not have any whitespace at the beginning and end removed.
match
any
Specifies the match type:
  • any - (default) If any of the criteria are met, the conditions match.
  • all - If all of the criteria are met, the conditions match.

See Also

Is there any way to show content only to the person who created the page? I'm using this with scaffolds and live templates, and want some content to only be visible by the page creator.

Thanks!

No, not really. I typically just use 'space=@self:edit', which means anyone who can edit the page gets the message. You might be able to do something like this:

{report-on:@self|injected=true}{show-to:user=%content:creator%}Message for the creator{show-to}{report-on}

You could probably also use Adaptavist's Replace and Render macro to the same effect.

Alternately, create a feature request to add something like 'user=@creator' or 'user=@editor' and we'll see about adding it in the future.

That works perfectly! Thanks so much!

I was going over this documentation and the thought struck me – what does {show-to:users=@self} actually do? When would a user not be themselves? Just curious?

Yeah, probably not that useful in this context. I'm pretty sure it's just a standard property build for parameters referring to users. It's more useful in other contexts.

It make sense that it could be an option that just happens to be available. I was just curious as to whether I understood the option correctly or if I was missing something.

Copyright(c) CustomWare Asia Pacific Pty Ltd
Powered by Atlassian Confluence 2.7.3, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators