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 )

15327 put(a) pogledan, 3 odgovor(a) 15.9.2011. 9:46:06Kreirao(la) Maxim
Maxim

Maxim

15.9.2011. 9:46:06
How can I set a access to entire site only for authorized users?
Ovaj sadržaj još nije ocijenjen. 
319 Reputacija 30 Ukupno objava
denis

denis

15.9.2011. 10:04:18
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.
Ovaj sadržaj još nije ocijenjen. 
7207 Reputacija 956 Ukupno objava
khorvat

khorvat

15.9.2011. 10:46:20
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
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava