-
Hello guys, I am kicking a new chat here about the User model implementation in the SDK. Different aspects are tackled here: Inheriting IPrincpalThe SSOM/CSOM object (SP)User is inheriting the (SP)Principal class, but as far as I know, only a few properties are common to the Principal contract, not any specific methods. However since it's the base class for User and Group, it might be handy, when using the SDK, to refer to them as a common base type (e.g. a collection of users and groups, ...) https://docs.microsoft.com/en-us/previous-versions/office/sharepoint-server/ee542393(v=office.15) The current idea is to expose the IPrincipal contract but not implementing it as concrete type (rather only in User, Group, ... concrete types) Do you have any suggestions about that, any functional or technical reason not to do it that way ? Seamless unified User concept across MS Graph and SharePointA common need I am more and more facing in my day to day work, is to work with either Graph or SP specific data refering to the same user. It think it would be really nice, from the SDK to have this unified concept of a user and being able to grab data from either API seamlessly without the need of handling some custom mapping logic in each and every piece of consumer software we write. Again, can you please provide any input you might have about this ? (ping @jansenbe @PaoloPia @pkbullock @JarbasHorst ) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Thanks for starting up this discussion @ypcode. Having a unified model that allows library users to deal with users in graph/rest neutral manner is important as we don't want that a library user to fully understand which type of API is called. Given that data returned by Graph or REST is different your approach of having another interface (your IPrincipal) that describes the user/group in an API agnostic way is a good one. For user collections we could introduce some methods that can return a list of IPrincipal. In order to allow for seamless switching between graph/rest calls we need to ensure that the needed Graph user metadata is set when a user/group is loaded via REST and the needed REST metadata is set for when a user/group is loaded via Graph. This logic needs to be added in the jsonserializer |
Beta Was this translation helpful? Give feedback.
-
Hi friends, Throwing some ideas and observations here:
Throwing plenty of brain dump here, please give any input you might have :) |
Beta Was this translation helpful? Give feedback.
Hi friends,
Throwing some ideas and observations here:
An entity already works through Graph and exists in the namespace
PnP.Core.Model.AzureActiveDirectory
.Should we have a dedicated namespace for a unified entity since it won't really be a 1 to 1 mapping with the Graph entity?
(not really a fundamental concern, but always better IMHO to organize well the code for the sake of quality)
A User in SharePoint is identified by a UPN or an ID but local to a particular Site, this ID is used to get SP specific properties or call SP Methods on a particular user. Thus we would need to key the entity with two different information in order to be able to call seamlessly MS Graph or SP REST. Do …