@@ -16,24 +16,39 @@ public interface IAuthorizationService
1616 /// Checks if a user meets a specific set of requirements for the specified resource
1717 /// </summary>
1818 /// <param name="user">The user to evaluate the requirements against.</param>
19- /// <param name="resource">The resource to evaluate the requirements against.</param>
19+ /// <param name="resource">
20+ /// An optional resource the policy should be checked with.
21+ /// If a resource is not required for policy evaluation you may pass null as the value.
22+ /// </param>
2023 /// <param name="requirements">The requirements to evaluate.</param>
2124 /// <returns>
22- /// A flag indicating whether authorization has succeded .
23- /// This value is <value>true</value> when the user fulfills the policy otherwise <value>false</value>.
25+ /// A flag indicating whether authorization has succeeded .
26+ /// This value is <value>true</value> when the user fulfills the policy; otherwise <value>false</value>.
2427 /// </returns>
28+ /// <remarks>
29+ /// Resource is an optional parameter and may be null. Please ensure that you check it is not
30+ /// null before acting upon it.
31+ /// </remarks>
2532 Task < bool > AuthorizeAsync ( ClaimsPrincipal user , object resource , IEnumerable < IAuthorizationRequirement > requirements ) ;
2633
2734 /// <summary>
2835 /// Checks if a user meets a specific authorization policy
2936 /// </summary>
3037 /// <param name="user">The user to check the policy against.</param>
31- /// <param name="resource">The resource the policy should be checked with.</param>
38+ /// <param name="resource">
39+ /// An optional resource the policy should be checked with.
40+ /// If a resource is not required for policy evaluation you may pass null as the value.
41+ /// </param>
3242 /// <param name="policyName">The name of the policy to check against a specific context.</param>
3343 /// <returns>
34- /// A flag indicating whether authorization has succeded.
35- /// This value is <value>true</value> when the user fulfills the policy otherwise <value>false</value>.
44+ /// A flag indicating whether authorization has succeeded.
45+ /// Returns a flag indicating whether the user, and optional resource has fulfilled the policy.
46+ /// <value>true</value> when the the policy has been fulfilled; otherwise <value>false</value>.
3647 /// </returns>
48+ /// <remarks>
49+ /// Resource is an optional parameter and may be null. Please ensure that you check it is not
50+ /// null before acting upon it.
51+ /// </remarks>
3752 Task < bool > AuthorizeAsync ( ClaimsPrincipal user , object resource , string policyName ) ;
3853 }
3954}
0 commit comments