• 隐藏“查看所有网站内容”


    根据我的实验,发现“查看所有网站内容”是有SharePoint里Role=“编辑项目”来控制的,所以当我们想让某一用户具有编辑权限,确不能查看所有网站内容时,就用到了下面的方法:

    借鉴:http://www.crsw.com/mark/Lists/Posts/Post.aspx?ID=36

    1. Open the SiteAction.xml file in Notepad from

    "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\EditingMenu\SiteAction.xml"

     

    2. Find the ConsoleNode element that defines the “View All Site Content” link (look for Action="cms:ViewAllSiteContentAction").

     

    3. Add “UserRights” and “RequiredRightsMode” attributes to define the permission levels that a user must have to see the link. For an example, see the ConsoleNode element for the Site Settings link.

     

    4. Run "iisreset /noforce" on the web server to make the change visible.

     

    5. Repeat for each web server on the farm.

     

    修改如下:

      <ConsoleNode Action="cms:ViewAllSiteContentAction" 

         DisplayText="cms,siteactions_viewallsitecontent_displaytext" 

         Description="cms,siteactions_viewallsitecontent_description"    

         UseResourceFile="true"    

         MenuGroupId="200"    

         Sequence="150"    

         PermissionContext="CurrentSite"

         UserRights="ManageWeb"

         RequiredRightsMode="Any"         

         ImageUrl="/_layouts/images/vwcntnt.gif"    

     ID="wsaViewAllContent"  />

     

     

     

    下面是来自MSDN上的关于:ConsoleNode UserRights 的介绍。

    1. ConsoleNode Properties

    (Microsoft.SharePoint.Publishing.WebControls)

    Public Properties

    Name

    Description

    AccessKey

    Gets or sets the Access Key of this ConsoleNode object.

    Action

    Gets or sets the ConsoleAction object that corresponds to this ConsoleNode object.

    Attributes

    Gets a collection of all Attributes properties pertaining to this ConsoleNode object.

    ChangedNodeId

    Gets or sets the ID of the ConsoleNode object being replaced, modified or deleted.

    ChildConsoleNodes

    Gets the collection of ConsoleNode objects that are children of this ConsoleNode object.

    ConfigMenu

    Gets or sets how this ConsoleNode object is used with the existing hierarchy.

    Description

    Gets or sets a string containing text that describes this ConsoleNode object.

    Enabled

    Gets or sets whether the ConsoleNode object should be enabled for the user.

    HasChildNodes

    Gets a Boolean value that indicates whether this ConsoleNode object has any child ConsoleNode objects.

    HideIfDisabled

    Gets or sets whether this ConsoleNode object should be hidden from view when it is disabled.

    HideStates

    Gets or sets the states for which this ConsoleNode object should be hidden.

    Id

    Gets or sets the ID of this ConsoleNode object.

    ImageUrl

    Gets or sets the URL of the image shown when this ConsoleNode is used.

    IsSeparatorImage

    Gets or sets whether this ConsoleNode object is a separator of other items.

    IsSiteRelative

    Gets or sets whether to interpret the NavigateUrl property as relative to the current SPWeb object.

    MenuGroupId

    Gets or sets the group ID in which this item should be displayed.

    NavigateUrl

    Gets or sets the href value of this ConsoleNode object.

    OriginalId

    Gets or sets the original ID of this ConsoleNode before an associated action modifies it.

    ParentNode

    Gets or sets the parent ConsoleNode of this ConsoleNode object.

    PermissionContext

    Gets or sets the context in which to evaluate the permissions of this ConsoleNode object.

    RequiredStates

    Gets or sets the states required for this ConsoleNode object to be enabled in the current context.

    RightsMode

    Gets or sets whether all or any UserRights properties must be satisfied.

    Sequence

    Gets or sets the place where this ConsoleNode object appears in the node order.

    Text

    Gets or sets the display text associated with this ConsoleNode object.

    Title

    Gets or sets the title of this ConsoleNode object.

    Type

    Gets or sets the type of this ConsoleNode object.

    UseActionImageUrl

    Gets or sets whether this ConsoleNode should use its own ImageUrl property or that of the referenced ConsoleAction object.

    UseActionNavigateUrl

    Gets or sets whether this ConsoleNode should use its own NavigateUrl property or that of the referenced ConsoleAction object.

    UseActionRightsMask

    Gets or sets whether this ConsoleNode should use its own UserRights property or that of the referenced ConsoleAction object.

    UseActionStatesMask

    Gets or sets whether this ConsoleNode should use its own RequiredStates property or those of the referenced ConsoleAction object.

    UseActionText

    Gets or sets whether this ConsoleNode object should use its own display text or that of a referenced ConsoleAction object.

    UserRights

    Gets or sets the rights required for this user to see this ConsoleNode object.

    Visible

    Specifies whether the ConsoleNode should be displayed to the user.

     

    2. SPBasePermissions Enumeration

    (Microsoft.SharePoint)

     

    Members

    Member name

    Description

    AddAndCustomizePages

    Add, change, or delete HTML pages or Web Part Pages, and edit the Web site using a Windows SharePoint Services–compatible editor.  

    AddDelPrivateWebParts

    Add or remove personal Web Parts on a Web Part Page.  

    AddListItems

    Add items to lists, add documents to document libraries, and add Web discussion comments.  

    ApplyStyleSheets

    Apply a style sheet (.css file) to the Web site.  

    ApplyThemeAndBorder

    Apply a theme or borders to the entire Web site.  

    ApproveItems

    Approve a minor version of a list item or document.  

    BrowseDirectories

    Enumerate files and folders in a Web site using Microsoft Office SharePoint Designer 2007 and WebDAV interfaces.  

    BrowseUserInfo

    View information about users of the Web site.  

    CancelCheckout

    Discard or check in a document which is checked out to another user.  

    CreateAlerts

    Create e-mail alerts.  

    CreateGroups

    Create a group of users that can be used anywhere within the site collection.  

    CreateSSCSite

    Create a Web site using Self-Service Site Creation.  

    DeleteListItems

    Delete items from a list, documents from a document library, and Web discussion comments in documents.  

    DeleteVersions

    Delete past versions of a list item or document.  

    EditListItems

    Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize Web Part Pages in document libraries.  

    EditMyUserInfo

    Allows a user to change his or her user information, such as adding a picture.  

    EmptyMask

    Has no permissions on the Web site. Not available through the user interface.  

    EnumeratePermissions

    Enumerate permissions on the Web site, list, folder, document, or list item.  

    FullMask

    Has all permissions on the Web site. Not available through the user interface.  

    ManageAlerts

    Manage alerts for all users of the Web site.  

    ManageLists

    Create and delete lists, add or remove columns in a list, and add or remove public views of a list.  

    ManagePermissions

    Create and change permission levels on the Web site and assign permissions to users and groups.  

    ManagePersonalViews

    Create, change, and delete personal views of lists.  

    ManageSubwebs

    Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.  

    ManageWeb

    Grant the ability to perform all administration tasks for the Web site as well as manage content. Activate, deactivate, or edit properties of Web site scoped Features through the object model or through the user interface (UI). When granted on the root Web site of a site collection, activate, deactivate, or edit properties of site collection scoped Features through the object model. To browse to the Site Collection Features page and activate or deactivate site collection scoped Features through the UI, you must be a site collection administrator.  

    Open

    Allow users to open a Web site, list, or folder to access items inside that container.  

    OpenItems

    View the source of documents with server-side file handlers.  

    UpdatePersonalWebParts

    Update Web Parts to display personalized information.  

    UseClientIntegration

    Use features that launch client applications; otherwise, users must work on documents locally and upload changes.   

    UseRemoteAPIs

    Use SOAP, WebDAV, or Microsoft Office SharePoint Designer 2007 interfaces to access the Web site.  

    ViewFormPages

    View forms, views, and application pages, and enumerate lists.  

    ViewListItems

    View items in lists, documents in document libraries, and view Web discussion comments.  

    ViewPages

    View pages in a Web site.  

    ViewUsageData

    View reports on Web site usage.  

    ViewVersions

    View past versions of a list item or document.  

     

     

  • 相关阅读:
    (转)JAVA国际化
    (转)实现这两个接口ModelDriven<T>,Preparable有什么用?
    cordova 与 phonegap关系
    NApache+JBOSS架构方案
    (转)Java 标注(Annotation)详解
    Jboss集群(五)--F5硬件负载均衡器双击热备 + Jboss集群终极实现
    GTK+/GNOME编程(一)
    二维数组中查找指定的数
    计算字符串距离
    统计指定数字的个数,并将其按权值10的次方数相加
  • 原文地址:https://www.cnblogs.com/LeimOO/p/1377602.html
Copyright © 2020-2023  润新知