Web部件和匿名用户 [英] Webparts & Anonymous users

查看:62
本文介绍了Web部件和匿名用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试开发一个网站,该网站将允许客户使用webparts设计其网站.但是有一个问题.登录的用户将通过从目录区域中选择Web部件来创建页面,然后匿名用户将看到设计的页面.但是Webpart仅适用于已登录的用户.因此,匿名用户看不到此页面.我该如何解决?

我的要求:

1)网站上只有一个登录用户(我称为admin).没有人将注册到该网站.
2)管理员将使用我的自定义Webparts设计自己的网站.
3)此过程之后,匿名用户将看到相同的页面,但他们将看到由登录用户设计的页面的最后出现.

但是匿名用户只有使用管理员帐户登录才能看到设计的页面.

谢谢您的所有帮助.

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.

推荐答案

好吧,您可以授予登录用户访问具有您的weBparts的页面的权限.并禁用匿名用户访问此页面.要授予用户权限,请检查以下两个msdn页面:

控制授权权限 [ ASP.Net授权 [
如果您不想以这种方式使用它,则可以使用另一个选项.去做吧;您可以在业务对象或控制器中实现一组权限查询方法.示例:CanRead(),CanEdit(),CanDelete(),CanAccess()..

页面呈现时,它需要查询业务对象并确定用户授权的功能,并根据此信息启用或禁用功能.反过来,业务对象可以使用角色"或其他数据库查询来确定活动用户的权限.

祝你好运.
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.


是的,我终于找到了解决方案.此处:

http://msdn.microsoft.com/en-us/library/ms178183.aspx [ ^ ]
Yes, i finally found out my solution. Here:

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


这篇关于Web部件和匿名用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆