Click here to Skip to main content
15,894,262 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I'm trying to develop a website which will allow clients to desing their websites using webparts. However there's a problem. A logged-in user will create a page by selecting webparts from catalog zone and after that anonymous users will see designed page. But webparts are for only logged-in users. So, anonymous users can't see this page. How can I solve this?

My requirements:

1) There will be only one logged user (I called admin) on website. Nobody will be register to the website.
2) Admin will design own website using my custom webparts.
3) After this process, anonymous users will see same pages but they will see the last apperance of page which have designed by logged user.

But anonymous users can't see designed page until logged-in with admin account.

Thank you for all your help.
Posted
Updated 26-Oct-11 12:15pm
v3

Well you can give the logged users permission to the page which have your weBparts. And disable the anonymous users to access this page. To give permission to the users check these two msdn pages:

Control authorization Permissions[^]
ASP.Net Authorization[^]
Keep in mind "?" is for anonymous users.

If you dont want to use it this way another option available. To do it; you can implement a set of permissions query methods in either your business objects or your controller. Examples: CanRead(), CanEdit(), CanDelete(), CanAccess()..

When the page renders, it needs to query the business object and determine the users authorized capabilities and enable or disable functionality based on this information. The business object can, in turn, use Roles or additional database queries to determine the active user's permissions.

Good luck.
 
Share this answer
 
Comments
mfozmen 25-Oct-11 19:13pm    
First of all thanks for your help.

However, I guess you misunderstood my problem. I want anonymous users to see webparts page. My requirements:

1) There will be only one logged user (I called admin) on website. Nobody will be register to the website.
2) Admin will design own website using my custom webparts.
3) After this process, anonymous users will see same pages but they will see the last apperance of page which have designed by logged user.

But, anonymous users can't see designed page until logged-in with admin account.
Orcun Iyigun 25-Oct-11 20:35pm    
I dont know but I think you still can apply my solution to this. Lets say you have the page that have webparts which is your design page, right? lets call it Design.aspx, and your final page is FinalDesign.aspx. you can only allow admin to access Design.aspx page and deny other user. And you can allow everyone for the FinalDesign.aspx page. Isnt your structure like this?
mfozmen 26-Oct-11 9:28am    
Yes this can be perfect for me but how can I apply this?
Orcun Iyigun 26-Oct-11 11:31am    
Well I wont tell you how to implement the code it is your business but for user access to a page a sample should be like this.

<!-- This section gives the unauthenticated user access to the Default1.aspx page only. It is located in the same folder as this configuration file. --><LOCATION path="default1.aspx"> <SYSTEM.WEB> <AUTHORIZATION> <ALLOW users="*"></ALLOW> </AUTHORIZATION> </SYSTEM.WEB> </LOCATION>
MAke the changes and place it to your web.config file
mfozmen 26-Oct-11 14:00pm    
Thanks for your help again but i know how to implement authorization settings. I mean how can i apply design.aspx for admin and result of this page how can be seen on finaldesign.aspx. How can i connect these 2 pages?
Yes, i finally found out my solution. Here:

http://msdn.microsoft.com/en-us/library/ms178183.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900