当前位置: 动力学知识库 > 问答 > 编程问答 >

piranha cms - Resstrict anonymouse user to access the site

问题描述:

We are building a website inwhich user must be authenticated before access the site. However, I don't know if it's possible to do that in Piranha?

I used

 <authorization>

<deny users ="?"/>

</authorization>

but it does not work.

Is anyone know how to do that?

Thanks

网友答案:

Piranha CMS uses forms authentication, so the above should work if you add a login url to the forms configuration in the web.config. I have used that setup myself for a couple of projects.

If you want to set restrictions on page level you can do this under Settings for a page, where you can choose the group needed to view the page.

If you're using MVC you can also add the [Authorize] attribute to your controllers/actions as usuall. Basically the normal steps should apply!

Regards

分享给朋友:
您可能感兴趣的文章:
随机阅读: