How do I remove the “Personalize this Page” option in WSS 3 with feature code?

删除回忆录丶 提交于 2019-12-01 22:39:35

It's a permission and can be accessed in the web UI of WSS:

Site Settings > People and Groups (under Users and Perms) > Site Permissions (left quick launch bar) > Settings > Permission Levels

Under each Permission Level there is a long list of permissions to include. At the bottom uncheck the items under Personal Permissions (mainly "Manage Personal Views").

I'm doing research on how to do it in code but our project requires custom user group administration so we just won't give them the option to Manage Personal Views.

Alternatively, the 'Personalize this Page' option will only be visable on pages containing web part zones that allow personalization. If you are using customised page layouts then you could set the 'AllowPersonalization' property to false on your web part zones.

Alternatively, you could enforce the shared view, thus disabling personalizations on your page. To accomplish this, do the following in any webpart, in the overriden OnLoad():

if (WebPartManager.Personalization.Scope == PersonalizationScope.User)
{
    WebPartManager.Personalization.ToggleScope();
}

However, this is not generally considered best practice because it could potentially affect the behavior of other webparts in your page.

Cory

It CAN be done and pretty easily. Open up Welcome.ascx in c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES

and underneath <SharePoint:MenuItemTemplate runat="server" id="ID_PersonalizePage" add Visible="False"

works perfectly but will change it globally for all sites. Add the same code to any of the other sections if wanted.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!