Solved

Rights information for Domain user

Posted on 2000-03-26
17
233 Views
Last Modified: 2010-05-18

Is it possible to get all the rights that user have on a domain ?

Share
FileShare
Groups
etc..

Palli
0
Comment
Question by:palli011000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 3
  • 3
  • +1
17 Comments
 

Author Comment

by:palli011000
ID: 2658506
I have Delphi 5, is it possible to fix this component ?
http://www.jgsoftware.com/files/accessrights.zip
0
 
LVL 17

Expert Comment

by:inthe
ID: 2658627
what error are you getting with component?
(and what code or line number gives error)

0
 

Author Comment

by:palli011000
ID: 2658851
I install first - cmpComputerAccessRights.pas -

Line: 68.

  if LookupPrivilegeDisplayName (PChar   (Computer), PChar (privilege), buffer, bufSize,    languageID) then

Error :

Types Of Actual And Formal Var Parameters
Must Be Identical

Palli.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:palli011000
ID: 2658855
Barry do you know what this component do ?

Palli.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2659025
to compile  try change the integer vars to cardinal so it look like:

var
  languageID : Cardinal;
  buffer : array [0..256] of char;
  bufSize : Cardinal;
begin
  bufSize := sizeof (buffer);
  if LookupPrivilegeDisplayName (PChar (Computer), PChar (privilege), buffer, bufSize, languageID) then
    result := buffer
  else


if you get that error again on other procedures/functions do the same for their vars if they are type integer and they give error change to cardinal..

btw.
i think this component will do what your after
0
 

Author Comment

by:palli011000
ID: 2659087
it works, but i don't know anything about this component. Do you have any solutions?
( demo etc.. ).

Many thanks
Palli.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2659151
sorry dont have nt here with delphi installed on to install component to test any examples on.

(you cant install this component on win9* only compile it.)
0
 

Author Comment

by:palli011000
ID: 2659180
I have NT4,

this component is to hard for me,

Palli
0
 
LVL 1

Expert Comment

by:yk030299
ID: 2659396
listen
0
 
LVL 20

Expert Comment

by:Madshi
ID: 2660194
I don't know this component. You can use GetFileSecurity/GetNamedObjectSecurity to get a security descriptor for files/shares. Then use GetSecurityDescriptorDacl to get the dacl of this security descriptor. Then you can use GetEffectiveRightsFromAcl to ask what rights your user has in this dacl. This is quite complicated stuff...   :-(

For user info you can use NetUserGetInfo or NetUserGetGroups.

Regards, Madshi.
0
 

Author Comment

by:palli011000
ID: 2662211
Madshi
do you have any examples of this functions?

Palli
0
 
LVL 20

Expert Comment

by:Madshi
ID: 2662988
Only for some, and those examples are deeply integrated in my private components collection (not published yet). So nothing I could offer you right now...   :-(

Sorry.

But you can look on this homepage for C++ knowledge:

http://www.wsb.poznan.pl/~pawel/vb/www.mvps.org/win32/network/nt95.html
0
 

Author Comment

by:palli011000
ID: 2663928
Madshi

If i want to use this function in my Delphi, what uses clause do i use to get it in the list

Uses Windows..........etc....

Palli
0
 

Author Comment

by:palli011000
ID: 2663936

HOW CAN I USE API FUNCTION THAT ARE IN DLL.
0
 

Author Comment

by:palli011000
ID: 2663955

HOW CAN I USE API FUNCTION THAT ARE IN DLL.
0
 
LVL 20

Accepted Solution

by:
Madshi earned 100 total points
ID: 2664043
Most of these functions are not declared anywhere. You have to declare them yourself, either statically or dynamically. This is an example for dynamic linking (extract from my components):

type
  // type for ISecurityObject.Type_, must be 4 byte long (needed by NT security APIs)
  {$minenumsize 4}
    TSecurityObjectType = (seUnknown, seFile, seService, sePrinter, seRegistry,
                                      seShare, seKernelObject, seWindowObject);
  {$minenumsize 1}

type
  // internal types for winNT security functions
  TSecurityInfo    = (siOwner, siGroup, siDAcl, siSAcl);
  TSecurityInfoSet = set of TSecurityInfo;
  PPAcl            = ^PAcl;
  PPSid            = ^PSid;

var
  // winNT security function variables
  GetNamedSecurityInfoW : function (objectName   : PWideChar;
                                    objectType   : TSecurityObjectType;
                                    securityInfo : cardinal;
                                    sidOwner     : PPSid;
                                    sidGroup     : PPSid;
                                    dacl         : PPAcl;
                                    sacl         : PPAcl;
                                    var sd       : PSecurityDescriptor) : cardinal; stdcall = nil;
  SetNamedSecurityInfoW : function (objectName   : PWideChar;
                                    objectType   : TSecurityObjectType;
                                    securityInfo : cardinal;
                                    sidOwner     : PSid;
                                    sidGroup     : PSid;
                                    dacl         : PAcl;
                                    sacl         : PAcl               ) : cardinal; stdcall = nil;
  GetSecurityInfoW      : function (handle       : cardinal;
                                    objectType   : TSecurityObjectType;
                                    securityInfo : cardinal;
                                    sidOwner     : PPSid;
                                    sidGroup     : PPSid;
                                    dacl         : PPAcl;
                                    sacl         : PPAcl;
                                    var sd       : PSecurityDescriptor) : cardinal; stdcall = nil;
  SetSecurityInfoW      : function (handle       : cardinal;
                                    objectType   : TSecurityObjectType;
                                    securityInfo : cardinal;
                                    sidOwner     : PSid;
                                    sidGroup     : PSid;
                                    dacl         : PAcl;
                                    sacl         : PAcl               ) : cardinal; stdcall = nil;

var dll : cardinal;
initialization
  dll := LoadLibrary(advapi32);
  // Windows unloads the library automatically when our program terminates...
  GetNamedSecurityInfoW := GetProcAddress(dll, 'GetNamedSecurityInfoW');
  SetNamedSecurityInfoW := GetProcAddress(dll, 'SetNamedSecurityInfoW');
  GetSecurityInfoW := GetProcAddress(dll,      'GetSecurityInfoW');
  SetSecurityInfoW := GetProcAddress(dll,      'SetSecurityInfoW');

Regards, Madshi.
0
 

Author Comment

by:palli011000
ID: 2664436
thanks
Palli
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi component that can load a DLL in design time? 8 106
Performance of SQL statement 37 147
FMX TEdit KeyUp handler detecting  "enter" key 4 62
IP without any Dots 1 99
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question