Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.

Tuesday, December 06, 2011

Doing Some Operation If User is Having Admin Priviledges to the Site...!

 try
            {
                SPSecurity.RunWithElevatedPrivileges(delegate()
                {
                    SPWeb currentWeb = SPContext.Current.Web;
                    if (currentWeb.CurrentUser.IsSiteAdmin)
                    {
                        writer.Write("Logged User is Having Admin Permissions to the Site...!");
                    }

                });
            }
            catch (Exception ex)
            {
                writer.Write(ex.ToString());
            }

No comments:

Post a Comment