Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Authority problem, I guess...

Authority problem, I guess...

Scheduled Pinned Locked Moved C#
csharpdotnethelpquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mcgahanfl
    wrote on last edited by
    #1

    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

    S L S H 4 Replies Last reply
    0
    • M mcgahanfl

      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

      S Offline
      S Offline
      Stefan Troschuetz
      wrote on last edited by
      #2

      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.


      www.troschuetz.de

      1 Reply Last reply
      0
      • M mcgahanfl

        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

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • M mcgahanfl

          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

          S Offline
          S Offline
          Steven Campbell
          wrote on last edited by
          #4

          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.


          my blog

          H 1 Reply Last reply
          0
          • S Steven Campbell

            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.


            my blog

            H Offline
            H Offline
            Heath Stewart
            wrote on last edited by
            #5

            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]

            1 Reply Last reply
            0
            • M mcgahanfl

              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

              H Offline
              H Offline
              Heath Stewart
              wrote on last edited by
              #6

              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 the PrincipalPermission, 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 or PrincipalPermission (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]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups