SPSite.HasAppPrincipalContext property
SharePoint 2013
Whether this [SPSite] object is running within an app principal context. When the [SPSite] object is running within an app principal context, the request permission may be restricted by the app principal's permission, even if the [SPSite] object is created with System account.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)