Note that there are some explanatory texts on larger screens.

plurals
  1. POLicense Based Configuration in C# Windows Application
    primarykey
    data
    text
    <p>I am working on a Windows application in C# (.NET 4.0) and need something to implement some basic ACL rules or more specifically, apply certain configurations based on the user type.</p> <p>The application has license keys that we are able to use to determine the user type (i.e. User, Installer, Engineer) among other pieces of information.</p> <p>Based on the type of user, certain features, menus, buttons, and display data will be different. I could just hard code showing and hiding of these elements in the application based on the user type, but we have a permissions matrix that defines the permissions so I would like to create an ACL so we could easily audit the matrix to the application code.</p> <p>I have looked around but a lot of the ACL and security code in the System.Security namespace seem to be made for Windows and Filesystem ACLs.</p> <p>Can someone recommend any existing classes (preferably free) that implement simple ACL's in C#.</p> <p>I just need to be able to do something like this:</p> <pre><code>ACL acl = new ACL(); acl.addRole("User"); acl.addRole("Manufacturer"); acl.addResource("SpecialButton"); acl.deny("SpecialButton"); acl.allow("SpecialButton", "Manufacturer"); // so later in my app I can do theUserType = "Manufacturer"; // ... if (acl.isAllowed(theUserType, "SpecialButton")) { SpecialButton.Visible = true; } </code></pre> <p>I'm not looking to try to stop people from tampering with code at runtime, if they want to go out of their way to do that then they can, but I would like an easy way to create and query the ACL's to determine how the GUI looks and what options are available when the program is loaded based on the key.</p> <p>It's easy enough to create this but if it is already done then that is even better.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload