How to Display Site Action Item based on permission?

First Add Item in Site Action using Feature

Feature.xml

<?xml version=”1.0″ encoding=”utf-8″ ?>
<Feature xmlns=”http://schemas.microsoft.com/sharepoint/&#8221;
Id=”588E6D6D-48D8-4FB9-8365-A8E7D57144D3″
Title=”Mukesh Kumar Custom Site Action Feature”
Description=”Adds Custom Actions to the Web Site.”
Scope=”Web”
Version=”1.0.0.0″>
<ElementManifests>
<ElementManifest Location=”Elements.xml”/>
</ElementManifests>
</Feature>

Elements.xml

<?xml version=”1.0″ encoding=”utf-8″?>

<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”&gt;

<CustomAction Id=”AppPageNavigationMenu” GroupId=”SiteActions”
Location=”Microsoft.SharePoint.StandardMenu”
Sequence=”1001″
Title=”MKS search”
Description=”Navigate to MKS search Page”
Rights=”ViewPages,ManageLists”>
<UrlAction Url=”http://devsp:5001/Pages/Search.aspx”  />
</CustomAction>
</Elements>

Note : Here Rights are given for ViewPages and ManageLists

Before associating permission to user, First Create Permission Role and  then add Permissions to the role (ViewPages and ManageLists permissions).

Now add permission role to user under Site Permission

SharePoint  premission List below:-
EmptyMask
ViewListItems
AddListItems
EditListItems
DeleteListItems
ApproveItems
OpenItems
ViewVersions
DeleteVersions
CancelCheckout
ManagePersonalViews
ManageLists
ViewFormPages
Open
ViewPages
AddAndCustomizePages
ApplyThemeAndBorder
ApplyStyleSheets
ViewUsageData
CreateSSCSite
ManageSubwebs
CreateGroups
ManagePermissions
BrowseDirectories
BrowseUserInfo
AddDelPrivateWebParts
UpdatePersonalWebParts
ManageWeb
UseClientIntegration
UseRemoteAPIs
ManageAlerts
CreateAlerts
EditMyUserInfo
EnumeratePermissions
FullMask

For more detail click here

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s