设置 SharePoint 应用程序页面的权限

发布于 2024-12-04 05:44:25 字数 252 浏览 5 评论 0 原文

我使用 Visual Studio 2010 开发了许多应用程序页面,并将它们部署在 SharePoint 2010 上。

所有页面均从 LayoutsPageBase 扩展。

目前,任何经过身份验证的用户都可以访问所有应用程序页面。但是,我想允许某些组/权限访问这些页面,并禁止其他组/权限访问。

我的问题:

如何将应用程序页面的权限设置为仅可由 SharePoint 级别和代码级别的某些组访问?

I have developed a number of application pages using visual studio 2010 and deployed them on SharePoint 2010.

All the pages have been extended from LayoutsPageBase.

Currently all the application pages are accessible by any authenticated users. However I would like to allow certain groups/permission to access these pages and disallow access for other groups/permissions.

My question:

How can I set the permissions for application pages to be accessible only by certain groups on the SharePoint level and on the code level?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

滥情哥ㄟ 2024-12-11 05:44:25

LayoutsPageBase 覆盖这些属性的组合:

这些属性由 CheckRights 方法来授予或拒绝对应用程序页面的访问。

如果您需要比这些属性提供的更具体的内容,请设置 RightsCheckModes 为 None,然后编写您自己的代码,如果用户不应具有访问权限,则抛出以下异常:

SPUtility.HandleAccessDenied((Exception) new UnauthorizedAccessException());

遵循 LayoutsPageBase 类的约定,应通过您的重写来调用此自定义代码OnLoadCompleteOnPreInit事件。

Override a combination of these properties from LayoutsPageBase:

These properties are used by the CheckRights method to grant or deny access to an application page.

If you need something more specific than these properties offer, set RightsCheckModes to None and then write your own code that throws the following exception if the user should not have access:

SPUtility.HandleAccessDenied((Exception) new UnauthorizedAccessException());

Following the convention of the LayoutsPageBase class, this custom code should be called by your override of either the OnLoadComplete or OnPreInit events.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文