SPUtility.GetTopEntitlement method
Among a collection of licenses for the same app, finds the most prevailing one.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Shared Function GetTopEntitlement ( _
entitlements As SPAppLicenseCollection _
) As SPAppLicense
'Usage
Dim entitlements As SPAppLicenseCollection
Dim returnValue As SPAppLicense
returnValue = SPUtility.GetTopEntitlement(entitlements)
public static SPAppLicense GetTopEntitlement(
SPAppLicenseCollection entitlements
)
Parameters
- entitlements
Type: Microsoft.SharePoint.SPAppLicenseCollection
Return value
Type: Microsoft.SharePoint.SPAppLicense
One of the highest class licenses.
Remarks
Conceptually, there is an order of domination between different types of licenses. This order is determined according to the following criteria, in descending order or importance: 1. Non-expired trial licenses and non-trial licenses dominate over expired licenses 2. Licenses with valid tokens dominate over licenses with invalid tokens 3. Licenses with more prevailing license types dominate over the others 4. Licenses with later acquisition dates dominate over the others This method is implemented to get the most dominating license from a set of licenses belonging to the same app. In the case of multiple licenses being the most dominating (according to the all of the criteria above), any of these is returned.