How to judge user rights in Sharepointdesigner custom pages

Source: Internet
Author: User

Sometimes it is necessary to judge the user's permission point in the custom development through the Sharepointdesigner, and to judge the user's identity according to the different permission points to provide different service, have a control Spsecuritytrimmedcontrol by default to provide the recognition rights, This control is especially useful if you want to have different behavior based on different permissions when you make a site order through Sharepointdesigner.

In the following example, depending on the permissions to set the different values of the script variable, please note that the permission string is the relationship, that is, the permissions will be superimposed.

<script>
    var msg = 0;
    var canbook = 0;
</script>
<sharepoint:spsecuritytrimmedcontrol runat= "Server" permissionsstring= " Addandcustomizepages, managelists ">
    <script>
        canbook = 1;
    </script>
</Sharepoint:SPSecurityTrimmedControl>

Attached to all permissionstring:

List Permissions
Managelists
Cancelcheckout
Addlistitems
Editlistitems
Deletelistitems
ViewListItems
Approveitems
Openitems
Viewversions
Deleteversions
Createalerts
Viewformpages
Site Permissions
Managepermissions
Viewusagedata
ManageSubwebs
ManageWeb
Addandcustomizepages
Applythemeandborder
Applystylesheets
Creategroups
Browsedirectories
Createsscsite
Viewpages
Enumeratepermissions
Browseuserinfo
Managealerts
Useremoteapis
Useclientintegration
Open
Editmyuserinfo
Personal Permissions
Managepersonalviews
Adddelprivatewebparts
Updatepersonalwebparts

Author: cnblogs Johnsonwang

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/web/sharepoint/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.