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

家住魔仙堡 提交于 2019-12-20 02:39:20

问题


How can I remove the "Personalize this Page" option in WSS 3.0? I'd like to do it in code with a feature at the web application level if possible.


回答1:


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.




回答2:


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.




回答3:


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.




回答4:


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.



来源:https://stackoverflow.com/questions/663828/how-do-i-remove-the-personalize-this-page-option-in-wss-3-with-feature-code

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