/
ISharePointUser.cs
115 lines (96 loc) · 3.77 KB
/
ISharePointUser.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
using System.Threading.Tasks;
namespace PnP.Core.Model.Security
{
/// <summary>
/// Public interface to define a SharePoint User
/// </summary>
[ConcreteType(typeof(SharePointUser))]
public interface ISharePointUser : IDataModel<ISharePointUser>, IDataModelGet<ISharePointUser>, IDataModelLoad<ISharePointUser>, IDataModelDelete, ISharePointPrincipal, IQueryableDataModel
{
/// <summary>
/// Id of the underlying graph object (if any)
/// </summary>
public string AadObjectId { get; set; }
/// <summary>
/// User principle name (UPN) of the user
/// </summary>
public string UserPrincipalName { get; set; }
/// <summary>
/// E-mail address of the user.
/// SP REST property name: Email
/// </summary>
public string Mail { get; set; }
/// <summary>
/// Department of the user
/// </summary>
public string Department { get; set; }
/// <summary>
/// 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.
/// </summary>
public string Expiration { get; }
/// <summary>
/// Indicates whether the user is a guest user authenticated via an e-mail address
/// </summary>
public bool IsEmailAuthenticationGuestUser { get; }
/// <summary>
/// Indicates whether the user is a guest user shared by e-mail
/// </summary>
public bool IsShareByEmailGuestUser { get; }
/// <summary>
/// Indicates whether the user is a site collection administrator
/// </summary>
public bool IsSiteAdmin { get; }
/// <summary>
/// Returns the collection of <see cref="ISharePointGroup"/> for this user
/// </summary>
public ISharePointGroupCollection Groups { get; }
/// <summary>
/// A special property used to add an asterisk to a $select statement
/// </summary>
public object All { get; }
/// <summary>
/// Returns this SharePoint user as a Graph user
/// </summary>
/// <returns></returns>
public Task<IGraphUser> AsGraphUserAsync();
/// <summary>
/// Returns this SharePoint user as a Graph user
/// </summary>
/// <returns></returns>
public IGraphUser AsGraphUser();
/// <summary>
/// Retrieves the role definitions for this user
/// </summary>
public IRoleDefinitionCollection GetRoleDefinitions();
/// <summary>
/// Retrieves the role definitions for this user
/// </summary>
public Task<IRoleDefinitionCollection> GetRoleDefinitionsAsync();
/// <summary>
/// Adds role definitions for this user
/// </summary>
/// <param name="names"></param>
/// <returns></returns>
public bool AddRoleDefinitions(params string[] names);
/// <summary>
/// Adds role definitions for this user
/// </summary>
/// <param name="names"></param>
/// <returns></returns>
public Task<bool> AddRoleDefinitionsAsync(params string[] names);
/// <summary>
/// Removes role definitions for this user
/// </summary>
/// <param name="names"></param>
/// <returns></returns>
public bool RemoveRoleDefinitions(params string[] names);
/// <summary>
/// Removes role definitions for this user
/// </summary>
/// <param name="names"></param>
/// <returns></returns>
public Task<bool> RemoveRoleDefinitionsAsync(params string[] names);
}
}