From: Carlos Vazquez on
Hi there!

I want to hide some folder into the app structure from the non-privileged users. I want only administrators to have rw access to that folder (and subfolders). So far so good.

The problem is that I have to know from inside my app what are the logged windows user rights on that folder (using windows api), so the app can have a different behaviour depending on them. How can I get that info?

Thx in advance.
--
Carlos Vazquez
cva(a)NOSPAMtelefonica.net
From: Geoff Schaller on
Carlos,

You want the good news or the bad news <g>.

The good news is that this is available using the NetUserGetInfo API -
the bad news is that I don't have an example of this because it is about
100 times easier in C#. There are some related APIs worth investigating
at the same time.

But the really bad news is that it might not work anyway because the
user may not even have rights to enquire as to the ACL properties of the
folder in question. Further, reading the rights on the folder does NOT
imply that the same rights apply to files and folders within.

Are you sure you want to go down this path? Might it not be easier to
just hide the folder and use the application to access or deny access to
it? What we do is apply rights based on the domain user group to which
the user belongs.

Geoff




"Carlos Vazquez" <cva(a)NOSPAM~telefonica.net> wrote in message
news:xn0grhc3njiw6e000(a)news.aioe.org:

> Hi there!
>
> I want to hide some folder into the app structure from the non-privileged users. I want only administrators to have rw access to that folder (and subfolders). So far so good.
>
> The problem is that I have to know from inside my app what are the logged windows user rights on that folder (using windows api), so the app can have a different behaviour depending on them. How can I get that info?
>
> Thx in advance.
> --
> Carlos Vazquez
> cva(a)NOSPAMtelefonica.net

From: John Martens on
Carlos,

It is not high science but you can build a special filenm, and test if
you can create the fil in the folder:

prtFileHandle := FCreate(cFileNmTest,FC_NORMAL)
IF prtFileHandle = F_ERROR

Then you will know at app startup if one hase write permission.

John



Op 10-3-2010 18:20, Carlos Vazquez schreef:
> Hi there!
>
> I want to hide some folder into the app structure from the non-privileged users. I want only administrators to have rw access to that folder (and subfolders). So far so good.
>
> The problem is that I have to know from inside my app what are the logged windows user rights on that folder (using windows api), so the app can have a different behaviour depending on them. How can I get that info?
>
> Thx in advance.
> --
> Carlos Vazquez
> cva(a)NOSPAMtelefonica.net
From: Carlos Vazquez on
Geoff Schaller wrote:

> Carlos,
>
> You want the good news or the bad news <g>.

See my answer at VOPS.

>
> The good news is that this is available using the NetUserGetInfo API - the bad news is that I don't have an example of this because it is about 100 times easier in C#.

Geoff, as you can see, I posted at clc-vo, so I expect a VO answer...

>
> But the really bad news is that it might not work anyway because the user may not even have rights to enquire as to the ACL properties of the folder in question. Further, reading the rights on the folder does NOT imply that the same rights apply to files and folders within.

I know the field I work on. So my only question is to know the properties that any user has over a particular folder.

--
Carlos Vazquez
cva(a)NOSPAMtelefonica.net
From: Carlos Vazquez on
John Martens wrote:

> Carlos,
>
> It is not high science but you can build a special filenm, and test if you can create the fil in the folder:
>
> prtFileHandle := FCreate(cFileNmTest,FC_NORMAL)
> IF prtFileHandle = F_ERROR
>
> Then you will know at app startup if one hase write permission.

John, I have thought about the same kind of solution, but perhaps there is a more elegant way that is easy to implement.

--
Carlos Vazquez
cva(a)NOSPAMtelefonica.net
 |  Next  |  Last
Pages: 1 2
Prev: SOAP in VO
Next: bBrowser Edit problem