MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Become a private social network  (Mono Support )

Viewed 14735 time(s), 3 post(s) 9/15/2011 9:46:06 AMby Maxim
Maxim

Maxim

9/15/2011 9:46:06 AM
How can I set a access to entire site only for authorized users?
This content has not been rated yet. 
319 Reputation 30 Total posts
denis

denis

9/15/2011 10:04:18 AM
Probably the easiest way to achieve this is to set the view privileges on each page that you need to hide from unauthorized users - there will be only 20 or so such pages in the default installation. When logged in as an admin, go to the page administration section (/MonoX/Admin/PageAdmin.aspx), right click on a page in the right pane, select page properties, and select the checkboxes in the "View roles" section for roles that should be allowed to view the page - in your case, these should probably be "Administrators" and "Users" role.
Note that you need to leave Login, Error, and other similar pages open to the public.
This content has not been rated yet. 
7207 Reputation 956 Total posts
khorvat

khorvat

9/15/2011 10:46:20 AM
Hi,

there is another way (easier way) to do this, if you want to modify the web.config, you need to configure the authorization section similar to this:
<configuration>
   <system.web>
      <authorization>
         <allow roles="Administrators"/>
         <deny users="*"/>
      </authorization>
   </system.web>
</configuration>

You can read more about this here.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts