In the previous article, I wrote a method to disable the personalization of SharePoint pages. But some people asked, What should I do if I only want the Administrator to personalize the page, but not the Administrator to do this? The following is the method. Note: This method is based on how SharePoint displays its "website operations" menu principle. That is to say, this method is based on its principle of "Inverted inference ", I have not performed a complete verification test on this method... :(
First, the master page of WSS 3.0 uses one of the following two methods to display the "website operations" menu in the upper-right corner of the page.
1. directly use the "Microsoft. Sharepoint. webcontrols. siteactions" control on the master page. For example, default. Master is like this:
2. Alternatively, use "Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ controltemplates \ publishingactionmenu. ascx (of course, this user control actually uses Microsoft. sharepoint. webcontrols. siteactions ). For example, blueband. Master:
Therefore, the following steps determine whether to directly modify the master page file or the user control based on the master page you are using. The following example uses default. Master, which is the first case.
The siteactions control is used as a nested control, similar:
<Siteactions>
<Customtemplate>
<Featuremenutemplate>
<Menuitemtemplate/> <--- each "menuitemtemplate" indicates a project in the website operation menu.
</Featuremenutemplate>
</Customtemplate>
</Siteactions>
Find the "<menuitemtemplate>" Node indicating "Edit page, the value of "permissionsstring" and "permissionmode" ("permissionsstring" indicates that only users with this permission can use this menu item. "fullmask" indicates all permissions, "manageweb" indicates managing the current website ):
Well, it's not over yet. Open "Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ layouts \ editingmenu \ siteaction. in the XML file, find the consolenode node whose ID is "wsaeditpage" and add the "userrights" attribute. (Why do we need to do this? Simply put, Sharepoint uses Microsoft. sharepoint. publishing. webcontrols. publishingsiteactionsmenucustomizer control to read the XML file, and then dynamically change the "website operations" menu .)
OK, complete. Theoretically, this method can be solved in a more "elegant" coding method, and then encapsulated into a solution package,... sometimes it is easier to solve problems quickly, isn't it? In addition, I believe that you can learn more from this blog, except to disable page personalization...