Interesting public/private forum visibility bug (or feature?)

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Interesting public/private forum visibility bug (or feature?)

Marc Martin
Hi all,

I just encountered some forum behavior that was a bit unexpected, so I'll pass it along here.

I'm setting up a forum that has public and private sub-forums.  At the top level, I'm using "category".

I've set up different access groups -- let's say, in addition to "Registered" and "Members" I've also got "Private" and "Super Private".  Where "Super Private" is a subset of the people who are in "Private".

So then I've got my sub-forums ordered like this:

  sub-forum 1 (public)
  sub-forum 2 (private)
  sub-forum 3 (super private)

And then I test it out and it all works as expected.  

However, if I reorder the sub-forums to be like this instead:

  sub-forum 1 (public)
  sub-forum 3 (super private)
  sub-forum 2 (private)

Then I get the unexpected behavior -- people who are in the "private" group can no longer view sub-forum 2 on the main page, even though they have been given permission to view it.  It would appear that they cannot see any sub-forums after they reach a sub-forum that they aren't supposed to view.  In this case, they don't have permission to see sub-forum 3 (super private), which is blocking their ability to view sub-forum 2 because sub-forum 2 is ordered after sub-forum 3.

This problem only occurs on the "Main Page".  If I go to "Topics View", then the person in the "private" group can see all of the posts in sub-forum 2.
Reply | Threaded
Open this post in threaded view
|

Re: Interesting public/private forum visibility bug (or feature?)

Pedro <Nabble>
Please, give me your forum's url again.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Interesting public/private forum visibility bug (or feature?)

Marc Martin
It's at:

  http://seattlesmartmeterforum.com/

And in this case, I've a got group called "Planning" to access several private sub-forums (e.g. SSM Council Forum), and a smaller group called "Steering" that is used to access one private sub-forum (SSM Steering).   However, if I order the "SSM Steering" sub-forum ahead of "SSM Council Forum", then the people who are supposed to be able to see "SSM Council Forum" can no longer see it.

So my solution at the moment is to simply put "SSM Steering" at the bottom.  
Reply | Threaded
Open this post in threaded view
|

Re: Interesting public/private forum visibility bug (or feature?)

GregChapman
In reply to this post by Marc Martin
Just one question (as I only have access to the "public" areas)...

Do the three sub-forums 1-3 that you describe each have the same parent forum - or is each the parent of another going down three levels?
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
Reply | Threaded
Open this post in threaded view
|

Re: Interesting public/private forum visibility bug (or feature?)

Marc Martin
They are all top-level subforums, so it looks like this:

  sub-forum 1 (public)
  sub-forum 2 (public)
  sub-forum 3 (private)
  sub-forum 4 (private)
  sub-forum 5 (private)
  sub-forum 6 (super private)

and leaving it in the above order, everything works.  It's just when I move the super-private sub-forum before the other ones do the other ones become invisible to those who should have access to them.
Reply | Threaded
Open this post in threaded view
|

Re: Interesting public/private forum visibility bug (or feature?)

GregChapman
Thanks for the clarification. I can now confirm your observation.

In my case I have an embedded Category app with a set of forum apps as sub-forums as follows:

The top-level Category app has "Smart Application Pages set and all user permissions set at default except: Create_topic, Reply, Show_group_members, which have all columns cleared. In addition, Edit_all is set on.

My sub-apps are in this order:

1. Public ("Anyone" can view this)
2. Restricted (only "Members" can view)
3. Super-Restricted (only "Special" can view)
4. Restricted (only "Members" can view)
5. Restricted (only "Members" can view)
6. Restricted (only "Members" can view)

Notes:
1. Being "Registered" grants you no additional benefits over "Anyone".
2. All those in the "Special" group are also in the "Members" group.

When I swap the positions of sub-forum 2 and 3 those in the "Members" group can then only see the  public sub-forum. This is also the case if I move the Super-Restricted group to the top position in the list so it is followed by the Public group and then all the Restricted groups.

I think I would count this as a bug, as I can't think of a case when this behaviour could be regarded as useful.
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
Reply | Threaded
Open this post in threaded view
|

Re: Interesting public/private forum visibility bug (or feature?)

Pedro <Nabble>
Greg,
your "root" forum is mixed. I think I fixed that problem on yours, didn't I?
I've just look your source code in order to remember what I have done.

Marc,
Please, try this:
Edit your category_table macro. Replace this code:
<n.loop.>
	<n.current_node.>
		<tr class="main-row [n.category_row_classes/]" node="[n.id/]">
			<n.columns/>
		</tr>
	</n.current_node.>
</n.loop.> 
with this one:
<n.loop.>
	<n.comment.>
		Here, the current node inside the loop is checked if it can be viewed by the visitor.
		If not, we check if there is a next node at the loop and jump to that. I there is no next node, the loop stops
	</n.comment.>                
	
	<n.if.not.current_node.can_be_viewed_by_visitor>
		<then><n.if.next_node><else><n.break/></else></n.if.next_node></then>
	</n.if.not.current_node.can_be_viewed_by_visitor>                                
	
	<tr class="[n.even_row_background/] main-row">
		<n.columns/>
	</tr>
	
	<n.if.next_node>
		<then>                        
			<n.if.not.current_node.can_be_viewed_by_visitor>
				<then><n.if.next_node><else><n.break/></else></n.if.next_node></then>
			</n.if.not.current_node.can_be_viewed_by_visitor>        
			
			<tr class="[n.odd_row_background/] main-row">
				<n.columns/>
			</tr>
		</then>
	</n.if.next_node>	
</n.loop.>
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Interesting public/private forum visibility bug (or feature?)

Marc Martin
> Please, try this:
> Edit your category_table macro. Replace this code:

Thanks,  that seems to fix the problem!

Marc
Reply | Threaded
Open this post in threaded view
|

Re: Interesting public/private forum visibility bug (or feature?)

Marc Martin
...or actually, no... that override made the private forums visible to the public.  :-(
Reply | Threaded
Open this post in threaded view
|

Re: Interesting public/private forum visibility bug (or feature?)

Pedro <Nabble>
Please, test again. I've made the following edit in your macro:
<override_macro name="category_privacy_js">
    <script type="text/javascript">
        var url = '/template/NamlServlet.jtp?macro=category_ajax&node=<n.root_node.id/>';
        $(document).ready(function() {
            function showPrivateRows() {
                $('tr.private').each(function() {
                    var nodeId = $(this).attr('node');
                    url += '&node=' + nodeId;
                });
                url = url + Nabble.getClientID();
                $.getScript(url);
            }
            if (Nabble.userId)
                showPrivateRows();
        });
    </script>
</override_macro>
Greg, you can also test this code.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Interesting public/private forum visibility bug (or feature?)

Marc Martin
That appears to be working, thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Interesting public/private forum visibility bug (or feature?)

GregChapman
In reply to this post by Pedro <Nabble>
Pedro <Nabble> wrote
Greg,
your "root" forum is mixed. I think I fixed that problem on yours, didn't I?
I've just look your source code in order to remember what I have done.
I fancy you are thinking of my "Ruston Reaches" forum.

For this topic I was using:
http://mbbb.2320619.n4.nabble.com/
which much more closely matches Marc's case.

I will be away for a few days from tomorrow and may not have the chance to test your code fully before next week.
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
Reply | Threaded
Open this post in threaded view
|

Re: Interesting public/private forum visibility bug (or feature?)

Pedro <Nabble>
Ok, until you come back we gonna release this fix, so that you can test when you return.
My test forum.