Issue Details (XML | Word | Printable)

Key: VISIB-22
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: David Peterson
Reporter: James Mortimer
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Confluence Extension: Visibility Plugin

Add 'anonymous' and 'authenticated' checks for {show-to} and {hide-from}

Created: 20/Mar/07 03:19 PM   Updated: 15/Nov/07 07:55 AM
Component/s: {hide-from}, {hide-if}, {show-if}, {show-to}
Affects Version/s: 1.4.4
Fix Version/s: 1.6.0

Time Tracking:
Not Specified


 Description  « Hide
Recipe on website shows how to use these to only show certain parts to authenticated users. Does not work on LDAP environment. We use this instead, which work with LDAP:

User Macro: show-to-anonymous
(using 2.3's options: has body, unrendered, and macro generates wiki markup)

#set($username=$action.getRemoteUser().getName())
#if($username && $username.length()>0)
## authenticated, do nothing
#else
## not authenticated, rendering body:
$body
#end

User Macro: show-to-authenticated

#set($username=$action.getRemoteUser().getName())
#if($username && $username.length()>0)
## authenticated, rendering body:
$body
#else
## not authenticated, do nothing
#end


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
James Mortimer added a comment - 21/Mar/07 03:56 PM
oops. I didn't specify what I'd like done to resolve this, just my workaround!

I'd like a specific 'show-to:anonymous' and 'hide-from:anonymous' (or perhaps user=anonymous?) functionality that works regardless of the confluence-users group.

also, a reciprocal show-to:authenticated (should be the same as hide-from:anonymous) and hide-from:authenticated (should be the same as show-to:anonymous)


David Peterson added a comment - 15/Nov/07 07:48 AM
Renamed the issue to better reflect the problem.

David Peterson added a comment - 15/Nov/07 07:55 AM
The option has been added by allowing '@anonymous' and '@authenticated' checks. Eg:
{show-to:user=@anonymous}Only show to anonymous users.{show-to}