Check if User has Full Permissions for Sharepoint List

In this blog we will check if the user has full permissions for the SharePoint List.

SPUser user = SPContext.Current.Web.CurrentUser; 

SPWeb oWeb = SPContext.Current.Web; 

SPList oList = oWeb.Lists["MyList]; 

string status= string.Empty; 

if (oList != null

     

     if (oList.DoesUserHavePermissions(user, SPBasePermissions.FullMask)) 

    { 

          status = "Administrator"

          } 

          else 

          { 

                status=  = "NonAdministrator"

          } 

 }