What I have been doing is tracing the stack when using Select and collect
with different types of 'read' parameters, and I find that it goes to
various spots in the NamespaceManager, rather than always passing through
NamespaceManager.Read everytime. What I have done is to selectively add
HasPermission at the various points called by Select and Collect within
NamespaceManager, and ensuring that it is at the lowest point in the stack
to cutoff unnecessary processing if it fails the HasPermission. I now have
all the spots where I think it is necessary, which was 3 additional checks
to the 2 or 3 Craig already had. Also I had to add a check in Formatter for
IncludedTopic, when there was no read permission for that included topic
within a topic that was readable.
There may still be some edge cases I did not find a way to get to, but I
used as many different varieties of WikiTalk that I could find or create
that used Select and/or Collect for topics. Now to write some unit tests.
John Davidson
On 10/1/07, David Ornstein <[EMAIL PROTECTED]> wrote:
>
> I think checking HasPermission on a case by case basis is probably the
> better way to go. It allow the behavior when permission is not available to
> be determined appropriately in context.
>
> For example:
> * When iterating over a collection of topics using Select, any topic that
> the user doesn't have permission for gets excluded.
> * When attempting to include one topic in another topic, the text "Topic
> can not be read: [topicname]" appears instead of the topic. (This is just
> an example to illustrate the point; I'm not proposing this particular result
> in this case).
>
> Now, specifically with respect to Select and Collect:
>
> I understand that the processing block that gets invoked for each item may
> perform operations other than read. I was suggesting that the very act of
> iterating over a topic was "performing a read" but I guess I see your point:
> this is not really a read operation so shouldn't be inherently restricted by
> having read permission. Perhaps it would make sense to do the permission
> checks in the places where reading is actually happening (e.g. when a
> property is accessed). Is that what you're suggesting?
>
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Flexwiki-users mailing list
Flexwiki-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flexwiki-users