Interface ISharePointUser
Public interface to define a SharePoint User
public interface ISharePointUser : IDataModel<ISharePointUser>, IDataModelParent, IDataModelWithContext, ISupportModules<ISharePointUser>, IDataModelGet<ISharePointUser>, IDataModelLoad<ISharePointUser>, IDataModelDelete, ISharePointPrincipal, IQueryableDataModel
- Inherited Members
- Extension Methods
Properties
AadObjectId
Id of the underlying graph object (if any)
string AadObjectId { get; set; }
Property Value
All
A special property used to add an asterisk to a $select statement
object All { get; }
Property Value
Department
Department of the user
string Department { get; set; }
Property Value
Expiration
A date/time string for which the format conforms to the ISO8601 time format YYYY-MM-DDTHH:MM:SSZ and which represents the time and date of expiry for the user. A null value indicates no expiry.
string Expiration { get; }
Property Value
Groups
Returns the collection of ISharePointGroup this user is a direct member of. Membership obtained indirectly, by being part of a Microsoft Entra ID group that is itself a member of the SharePoint group, is not expanded and therefore not returned. Use GetTransitiveGroupsAsync() for that.
ISharePointGroupCollection Groups { get; }
Property Value
IsEmailAuthenticationGuestUser
Indicates whether the user is a guest user authenticated via an e-mail address
bool IsEmailAuthenticationGuestUser { get; }
Property Value
IsShareByEmailGuestUser
Indicates whether the user is a guest user shared by e-mail
bool IsShareByEmailGuestUser { get; }
Property Value
IsSiteAdmin
Indicates whether the user is a site collection administrator
bool IsSiteAdmin { get; }
Property Value
E-mail address of the user. SP REST property name: Email
string Mail { get; set; }
Property Value
UserPrincipalName
User principle name (UPN) of the user
string UserPrincipalName { get; set; }
Property Value
Methods
AddRoleDefinitions(params string[])
Adds role definitions for this user
bool AddRoleDefinitions(params string[] names)
Parameters
namesstring[]
Returns
AddRoleDefinitionsAsync(params string[])
Adds role definitions for this user
Task<bool> AddRoleDefinitionsAsync(params string[] names)
Parameters
namesstring[]
Returns
AsGraphUser()
Returns this SharePoint user as a Graph user
IGraphUser AsGraphUser()
Returns
AsGraphUserAsync()
Returns this SharePoint user as a Graph user
Task<IGraphUser> AsGraphUserAsync()
Returns
GetRoleDefinitions()
Retrieves the role definitions for this user
IRoleDefinitionCollection GetRoleDefinitions()
Returns
GetRoleDefinitionsAsync()
Retrieves the role definitions for this user
Task<IRoleDefinitionCollection> GetRoleDefinitionsAsync()
Returns
GetTransitiveGroups()
Returns the SharePoint groups of the current site this user is a member of, either directly or through a Microsoft Entra ID security group (including nested groups) or Microsoft 365 group that is a member of the SharePoint group. Whenever the site groups contain such a group this uses Microsoft Graph, which requires the GroupMember.Read.All permission next to permission to read the principal itself. The special "Everyone" and "Everyone except external users" claims are not taken into account.
IList<ISharePointGroup> GetTransitiveGroups()
Returns
- IList<ISharePointGroup>
The SharePoint groups this user is a direct or transitive member of
GetTransitiveGroupsAsync()
Returns the SharePoint groups of the current site this user is a member of, either directly or through a Microsoft Entra ID security group (including nested groups) or Microsoft 365 group that is a member of the SharePoint group. Whenever the site groups contain such a group this uses Microsoft Graph, which requires the GroupMember.Read.All permission next to permission to read the principal itself. The special "Everyone" and "Everyone except external users" claims are not taken into account.
Task<IList<ISharePointGroup>> GetTransitiveGroupsAsync()
Returns
- Task<IList<ISharePointGroup>>
The SharePoint groups this user is a direct or transitive member of
RemoveRoleDefinitions(params string[])
Removes role definitions for this user
bool RemoveRoleDefinitions(params string[] names)
Parameters
namesstring[]
Returns
RemoveRoleDefinitionsAsync(params string[])
Removes role definitions for this user
Task<bool> RemoveRoleDefinitionsAsync(params string[] names)
Parameters
namesstring[]