Why would an SPO webpart on a modern page only be functional for site admins? - permissions

I have created a simple (display only) SPFx webpart that makes calls into a list on the same site as it is used. Standard users have read access over this list, site owners have Full Control. When I add the part to a page, even site owners cannot see it. Site Members (& Owners) are able to see the page (published or not), but the content which should be displayed by the webpart is missing. Note that the basic html is visible, but the data which should be retrieved is not. If I elevate a site owner to a site admin permission level, the webpart then works as intended and data is retrieved correctly and displayed. Note also that other webparts on other pages served from the same library work correctly for all groups.
Does anyone have any suggestions to explain this behaviour?
I have tried: Rebuilding and publishing webparts, new test pages created by the same and other user accounts both published and unpublished. I've carefully changed permissions on the "Site pages" library, the "ClientSideAssets" library and the site scoped app library itself.

I've answered my own question here. The error was caused by a REST query into the SPO list that contained a taxonomy (managed metadata) field. Expanding this field appeared to require the highest permission levels, thus all non admin users were unable to retrieve the data.
I later found an excellent article detailing the subject here.
I was able to trace this by serving through gulp into the online workbench, copying that URL into an incognito window for a different user account, and utilising the (Chrome) debugging tools. This tidy solution might potentially be of use to someone.

Related

How do I test a website in webmaster tools without indexing it

Suppose I have my live site at www.mywebsite.com, tracked and managed via Google Webmaster Tools. Then I want to add to the project list a subdomain like test.mywebsite.com which I use for testing purposes. Of course that subdomain shouldn't be tracked or indexed by Google, but I would like to use "fetch as Google" feature on it to see how the crawler manages the pages. Can I set up such a test environment without being indexed by Google?
Not had chance to test this, but I think if you add noindex tags to your site then it should still allow your site to be registered with webmaster tools, as it can still see the site's content in order to detect ownership.
I believe "fetch as google" then returns live results rather than what is already indexed (it wouldn't be very useful if it didn't allow you to check new pages or re-check updated pages), and so temporarily removing the noindex tag when you run it should allow this feature to be used (it may also return some useful information without removing it).
The fact "fetch as" has a separate "submit" button suggests to me that it will not automatically index pages found via this method, so that should not be a concern.
Adding canonical tags pointing to your main content would provide an additional security measure to stop it accidentally listing.
Google can't provide any information about your website if it's not indexed.
In other words, you can use Google Webmaster Tools without your website being indexed, but it will be pretty much useless, since will not provide any data.
Google webmaster tools won't let you do that but you can test a website for seo checkup or other errors like search description missing,image alt missing etc with bing webmaster tools

Login-Window on anonymous access in sharepoint

Whenever we deploy our sharepoint website we have pages that show a login-window to anonymous users (and after that a 401 if the user does not login). This login-window disappears once we login from any machine. After that: The anonymous users can watch that site, too.
The Page is in a published state and has a major version.
This is no big problem for us as we can solve it like described above. I just wonder what causes this weird behaviour. Any idea?
Solved!
It really was a strange reason. (Easy once I found out). This time it is surprisingly no sharepoint-error.
The problem was the following: We use a webpart that generated thumbnails in the correct size so our users can assign pictures of any size. These thumbnails are then saved in the cache. Now our users added the sharepoint-thumbnail of those pictures which lie in a protected area.
Now when logged in the protected images are collected and saved in the Cache which can be accessed by anyone.
Simple reason - complex error behaviour :)

prevent duplicate site / page / layouts / templates / webparts, possible

We have a sharepoint environment with many sites (and sometimes many site collections). Each site (or site collection) has the same default page with some custom webparts that use sitecolumn values (for example a projectcode or clientcode) to show information from external systems. (for each project we have to create a separate site (or site collection) because of other reasons)
What is the best approach to minimize duplication? The dynamic parts of the page are stored in site columns. When we add a new webpart, ideally the default page every site/page should show the new webpart without spreading the update to the individual pages
Thanks
One approach you may want to take is to use the web part as a wrapper for a user control. The user control does the heavy lifting on the site. Once the web part is included on your pages, the user control should be able to tell which site it is being executed on and pull the necessary dynamic data from your site columns.
When you need to make updates, you update the user control and then redeploy the solution package to the farm. Each site will pick up the change as soon as the solution is deployed.
Here is a little information about this approach:
http://msdn.microsoft.com/en-us/library/ff649867.aspx.
The above article relates to WSS 3.0, but that should give you a starting point.
An approach you may want to look at for SharePoint 2010 is a visual web part. More info can be found here: http://msdn.microsoft.com/en-us/library/ff597539.aspx.

SharePoint 2010: Point a PortalSiteMapProvider to a specific site collection

Is it possible to get an OOTB PortalSiteMapProvider to provide a site heirarchy from a specified site collection or URL (i.e. not the current site collection) in SharePoint 2010? In MOSS this was only possible by creating a custom SiteMapProvider, traversing the site collections and manually building the navigation tree.
NB: I am not prepared to write a
custom SiteMapProvider that reads from
a static XML (.sitemap) file as the regular site contributors may not have access to files on the file system.
A little bit of background... I have a single web application with 2x site collections:
1 for my intranet portal at http://intranet/ (publishing enabled)
1 for the My Sites at http://intranet/my (publishing not enabled)
We have no plans to facilitate multiple portals, therefore, I would like a consistant global navigation bar across both site collections. Ideally, I'd like the My Sites to show the site heirarchy from the main portal site. So is it possible to set the PortalSiteMapProvider.CurrentSite property to "http://intranet/" instead of "http://intranet/my"?
To achieve this behaviour I wrote my own web service which goes off and traverses another site collection's hierarchy (using it's own PortalSiteMapProvider), and returns that structure as an XML document. I obviously then bound my global navigation navigation menu to that.
I got the concept from here: PortalSiteMapProvider
There is a similar approach describes here which uses HttpHandlers instead: http://blog.symprogress.com/2011/03/sharepoint2010-custom-navigation-provider-cross-sitecollection/

Access a MySite Blog from a home page webpart

I've been away from SharePoint development for quite a while now, and I'm trying to access the information in a SharePoint 2010 blog (from one of our users, within their "MySite") from a C# webpart which will reside on the homepage of the site. The idea is to be able to highlight a certain user's latest post on the home page.
Can anyone help me to reference the blog (in dev it is located at http://myServer/my/BillsBlog) from our homepage. I've tried the following...
Reference an SPSite giving the URL as a constructor parameter, then get the correct web from there. This fails. (I'm guessing the blog is a web, rather than a site collection, but am open to being corrected there)
Get the current context from SPContext.Current, and access the AllWebs collection from there, but this doesn't inculde the /my web.
Once I find the appropriate container (SPSite or SPWeb) I can access the list to pull out the items I need, but I don't know how to get to that point. In a console App, I have it working by using the method in the first bullet abouve.
I'm really pretty much stuck now, and I simply don't know enough about what I'm looking fro to be able to search Google for answers. Any help you could give me would be greatly appreciated.
OK, my mistake. The webpart project was set up as a sandboxed one, so the approach in bullet 1 wouldn't work. Changing that switch meant it is now OK and working as per the console app.
Thanks for reading.