all users vs anonymous users

This is a forum to suggest new features for mojoPortal. 

This thread is closed to new posts. You must sign in to post in the forums.
6/21/2006 10:57:42 AM
Gravatar
Total Posts 58

all users vs anonymous users

Is there a anonymous users security role that I can use in my module view security rule?  I want a module to go away if the user is logged in.
6/21/2006 11:21:02 AM
Gravatar
Total Posts 18439

Re: all users vs anonymous users

There is an authenticated users role that all registered users are added to, but there can be no roles for anonymous users, you can only check roles if the user is logged in.

If you want to hide a control or module when a user is logged in, you can put something in page load of the control like this:

this.Visible = !Request.IsAuthenticated;

or if you want to do it from a containing control or page:

somecontrol.Visible = !Request.IsAuthenticated;

Joe
6/21/2006 11:31:35 AM
Gravatar
Total Posts 58

Re: all users vs anonymous users

couldn't we make a setting in default module settings for IsAuthenticated and put in a check box near roles that can view this module called registered  and one call unregistered.

 

ie roles would be:

all, registered, unregistred,admin,content etc.

6/21/2006 11:56:39 AM
Gravatar
Total Posts 18439

Re: all users vs anonymous users

Right now view permissions are at the page level. We could possibly add them at the module level but it would pose some challenges and add some complexity that I have been trying to avoid.

For example, consider the search feature, content is indexed at the page level and page permissions are stored in the search index along with the search stuff. So anytime permissions are changed on a page we have to re-index all the content on the page so that the search index permissions stay in sync and users can't get search results for content they have no permission to view. This will get much more complicated if we start having to do this at the module level and performance could be a real problem because there are some pages that we want to avoid re-indexing as much as possible. The page with the forums for example. We have over a thousand posts and if permissions are changed on the page that contains the forums all those posts have to be re-indexed so I try to avoid changing permissions on that page.
Now if we extend the view permissions onto module instances we have to also re-index the whole contents of the page if view permissions change on any module that lives on the page and we have to keep even more permissions stored in the index.

Now you might think we could just change to index content at the module level instead of the page level but that won't work because modules can be on any number of pages and the pageid is not really property of the module though it knows what page it is on when it is on one it may not know when the content is created or saved. We have to know what page the content is one in order to build a link in the search results.

I'm not saying it can't be done, maybe it can but one of my design mantras is avoid complexity unless it really brings a lot of value to do the thing that requires complexity.
6/21/2006 12:11:58 PM
Gravatar
Total Posts 58

Re: all users vs anonymous users

So it might be better to build a custom module that does it's own IsAuthenticated than to do it inside the framework.  Yes, I understand.  Much less overhead this way.  Maybe this overhead is why other frameworks are running slower than MojoPortal nowadays.

http://www.ibegin.com/ibox/ibox-test.html has a cool log in fade.  I was turned onto that from Ryan Watts

6/21/2006 12:27:48 PM
Gravatar
Total Posts 18439

Re: all users vs anonymous users

There is a new 2.0 .NET server control called loginview that allows you to display different content for logged in users and anonymous users.
http://www.asp.net/QuickStart/aspnet/doc/ctrlref/login/loginview.aspx

It might also be an option in some circumstances.

Joe
You must sign in to post in the forums. This thread is closed to new posts.