Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
    
Could you post your custom action please ? Have you used List or ContentType registration? I think if you use List reegistration, that it will look for AddItem rights on the LIST (not on item). So you might need to register it on the Folder content type. –  Frederik P. Aug 23 '12 at 11:40
    
i have added the code above i will try the content type –  Matthew Burrows Aug 23 '12 at 12:40
    
uhm, I guess u forgot to paste part of the cosutom action? –  Frederik P. Aug 23 '12 at 13:43
    
i pasted it all but it doesn't show it all. –  Matthew Burrows Aug 23 '12 at 13:51
    
its there if i go to edit I have changed it to use contenttype and folder and it still doesn't work –  Matthew Burrows Aug 23 '12 at 13:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.