I have a sharepoint 2010 site with a library.
this library has three subfolders.
the system admin has full control over the whole library.
All users have read only rights to the whole library.
User A has additem rights to folder A User B has additem rights to folder B User C has additem rights to folder C
I have added a custom action button to the ribbon that looks for AddItem rights.
SysAdmin see the button for all folders. Users A,B and C don't see it at all.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="Ribbon.Documents.CustomNew"
Location="CommandUI.Ribbon"
RegistrationType="ContentType"
RegistrationId="0x0120"
Rights="AddListItems">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.Documents.Groups._children">
<Group Id="Ribbon.Documents.CustomNew"
Sequence="55"
Description="Custom New Group"
Title="New"
Command="EnableCustomGroup"
Template="Ribbon.Templates.Flexible2">
<Controls Id="Ribbon.Documents.CustomNew.Controls">
<Button
Id="Ribbon.Documents.CustomNew.NewDocument"
Command="Ribbon.Documents.CustomNew.NewDocCommand"
LabelText="New Document"
Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="0" Image32by32Left="-64"
TemplateAlias="o1"
Sequence="10"
/>
</Controls>
</Group>
</CommandUIDefinition>
<CommandUIDefinition
Location="Ribbon.Documents.Scaling._children">
<MaxSize
Id="Ribbon.Documents.Scaling.CustomNew.MaxSize"
Sequence="15"
GroupId="Ribbon.Documents.CustomNew"
Size="LargeLarge"/>
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler
Command="EnableCustomGroup"
CommandAction="javascript:return true;"></CommandUIHandler>
<CommandUIHandler
Command="Ribbon.Documents.CustomNew.NewDocCommand"
CommandAction="javascript:alert('New Document');">
</CommandUIHandler>
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
</Elements>
I need users A,B and C to only see it in subfolders where they have AddItem Rights.
Can someone please help me.