Deleting WebApp Permission Level




Go back to index

How to delete web application permission level


Following code block explains how to programmatically delete a permission level for a web application.

      using System;
      using SPTool.Library;
      
      namespace SPTool.Test
      {
          class Program
          {
              static void Main(string[] args)
              {
                  SPTWebApplication webApplication = new SPTWebApplication("http://sptool/");

                  // Delete Permission Level in the web application
                  SPTReturn returnObj = webApplication.DeletePermissionLevel("Dummy Permissions");

                  // Check the status of deleting permission level
                  if (returnObj.State == SPTState.Success)
                  {
                      // Deleting Permission Level Successful
                  }
                  else
                  {
                      // Deleting Permission Level Failed
                  }
              }
          }
      }


Go back to index