Forum Discussion

Stefaan De Vreese's avatar
Stefaan De Vreese
Brass Contributor
Aug 06, 2018

Doc Library webpart "New" button missing

Hi guys,

 

I'm experiencing some weird behaviour from the Document Library webpart. When provisioning a new site through code, we add the doc library webpart to the first section programatically. 

But even though the "Everyon" group has contribute rights, the user cannot see the "New" button on the webpart. The "sync" button is also gone as is the "view" selection button. 

 

but when I view the site as site collection admin i can see all the buttons

 

So I'm guessing its a permissions issue, but "Everyone" hase contribute rights. And even if I make "Everyone" Owner of the site, they still cant see the new button.

 

Maybe we made a mistake while adding the webpart through code, but then you would expect that adding a new webpart manually would solve it, but even then, the "new" button is still not visible. 

 

So it must be a permissions issue, but no clue why. 

I do see some change in the permissions side panel. Is MS doing something with it??

Where are the group labels???

 

3 Replies

  • So, we isolated the code where this goes wrong.

    "updatedList" here is our document library where we add custom content types through code

     

    var updatedListCTs = updatedList.ContentTypes;
    Context.Load(updatedListCTs);
    Context.ExecuteQueryRetry();

     

    //loading the CTs from the web where we have our Doc Lib

    ContentTypeCollection siteCTs = Context.Web.ContentTypes;
    Context.Load(siteCTs);
    Context.ExecuteQueryRetry();

     

    //here we add one of the web CT to the Doc Lib

    updatedList.ContentTypes.AddExistingContentType(siteCT);

    updatedList.Update();
    Context.ExecuteQueryRetry();

     

    At this point, the New button is gone for all users except the SP Admin user.

     

    • Stefaan De Vreese's avatar
      Stefaan De Vreese
      Brass Contributor

      Maybe its not even the code, because several users in the company are able to see the "new" button while others can't...

      But these users have the same permissions...

       

      We also thought it had something to do with languages, but even if we tweak site/browser/computer language, the results are the same. Some users can see the button, others can't

       

      So we could use some help to figure this out...

Resources