Recent

Author Topic: User privilege  (Read 3223 times)

xinyiman

  • Hero Member
  • *****
  • Posts: 2259
    • Lazarus and Free Pascal italian community
User privilege
« on: April 04, 2011, 12:01:38 pm »
Assume that I have a user name that is connected to the computer, how do I know if he has administrator rights in windows / linux? and if no user-level administrator who is?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
Re: User privilege
« Reply #1 on: April 04, 2011, 01:03:38 pm »
Depending on granularity you need, in unix, it's usually the root user (PID 0) who has all the rights.

No idea for windows. Note that this is a very poor mechanism.

xinyiman

  • Hero Member
  • *****
  • Posts: 2259
    • Lazarus and Free Pascal italian community
Re: User privilege
« Reply #2 on: April 05, 2011, 11:55:13 am »
How do I get the PID via lazarus for linux?
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1

ik

  • Jr. Member
  • **
  • Posts: 88
  • ik
    • LINESIP
Re: User privilege
« Reply #3 on: April 05, 2011, 11:57:56 am »
You can use fpGetPID

 

TinyPortal © 2005-2018