Exemple #1
0
        /// <summary>
        /// Does this web have a site policy applied?
        /// </summary>
        /// <param name="web">Web to operate on</param>
        /// <returns>True if a policy has been applied, false otherwise</returns>
        public static bool HasSitePolicyApplied(this Web web)
        {
            ClientResult <bool> hasSitePolicyApplied = ProjectPolicy.DoesProjectHavePolicy(web.Context, web);

            web.Context.ExecuteQueryRetry();
            return(hasSitePolicyApplied.Value);
        }
Exemple #2
0
        /// <summary>
        /// Does this web have a site policy applied?
        /// </summary>
        /// <param name="web">Web to operate on</param>
        /// <returns>True if a policy has been applied, false otherwise</returns>
        private static async Task <bool> HasSitePolicyAppliedImplementation(this Web web)
        {
            var hasSitePolicyApplied = ProjectPolicy.DoesProjectHavePolicy(web.Context, web);
            await web.Context.ExecuteQueryRetryAsync();

            return(hasSitePolicyApplied.Value);
        }