title: Working with Permission Attribute
body: <p>I'm probably just getting the concept wrong, but still i thought I should ask:</p>
  
  <p>I'm trying to find the specific permissions needed to create a new local user group in Win2008. I went over the <code>System.DirectoryServices.AccountManagement</code> namespace and declared the permissions needed:</p>
  
  <pre><code>[SecurityPermissionAttribute(SecurityAction.Assert, Flags = SecurityPermissionFlag.UnmanagedCode)]
  [DirectoryServicesPermissionAttribute(SecurityAction.InheritanceDemand, Unrestricted = true)]
  [DirectoryServicesPermissionAttribute(SecurityAction.LinkDemand, Unrestricted = true)]
  </code></pre>
  
  <p>I expected to get an exception when one of these permissions will be denied (i.e. when entering the method). Instead I still get <code>UnauthorizedAccessException</code> when calling the principal <code>Save</code> method.</p>
  
  <p>What am I missing here? I'm looking for an answer more in regards to using the permissions attributes, than a solution to this specific issue.</p>
  
  <p>Thanks.</p>