Authority problem, I guess...
-
-
We have problems with two software packages. Both packages require the .NET framework be installed. Both vendors software works great for the ADMIN, but both throw exceptions for users that are not ADMIN. Can you point me in the right direction? thanks
I'm pretty sure your program tries to do something which is denied by the OS and as a result the exception is thrown. It would be helpful to know which exceptions are thrown and even more important which operations caused them.
-
We have problems with two software packages. Both packages require the .NET framework be installed. Both vendors software works great for the ADMIN, but both throw exceptions for users that are not ADMIN. Can you point me in the right direction? thanks
McGahanFL wrote: Can you point me in the right direction? What exception would that be? top secret
Download xacc-ide 0.0.3 now!
See some screenshots -
We have problems with two software packages. Both packages require the .NET framework be installed. Both vendors software works great for the ADMIN, but both throw exceptions for users that are not ADMIN. Can you point me in the right direction? thanks
Can you point me in the right direction? Another vendor? Unless you specifically need the applications to do admin-type things, it is inexcusable for commercial .NET software to require admin rights.
-
Can you point me in the right direction? Another vendor? Unless you specifically need the applications to do admin-type things, it is inexcusable for commercial .NET software to require admin rights.
It's inexcusable for any application to require admin rights if, indeed, it doesn't require them (i.e., a system management package would most likely require admin rights, and justly so). This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]
-
We have problems with two software packages. Both packages require the .NET framework be installed. Both vendors software works great for the ADMIN, but both throw exceptions for users that are not ADMIN. Can you point me in the right direction? thanks
Because software must be careful about requiring admin privileges (for example, why should calc.exe require admin privileges), you must be careful about using features that require admin privileges. This includes writing user preferences or data to protected registry hives (like HKEY_LOCAL_MACHINE) or directories (like %WINDIR%), and many more. If, at times, your software requires admin privileges, either be prepared to catch
SecurityException
or similar exceptions (the BCL method documentation should state what could be thrown), or use Code Access Security (CAS) - namely thePrincipalPermission
, to either declaratively or imperatively demand permissions with a certain group. A good starting point to learn CAS is Understanding .NET Code Access Security[^] right here on CodeProject. Be sure to follow the links. So, if you had a method that required Admin privileges (say to enumerate a certain protected DC in Active Directory), you could code your method like so:[PrincipalPermission(SecurityAction.Demand, Role="Administrators")]
public IEnumerator GetADEnumerator(string path)
{
// ...
}Do note that using the
PrincipalPermissionAttribute
orPrincipalPermission
(for declarative security) does require to either hard-code a domain name (i.e., "MYDOMAIN\Domain Admins") or to use a local group where a domain or machine name isn't required). In these cases, catch exceptions is a better choice (and should be done anyway since calling a protected method using CAS will still throw an exception). This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles]