Re: Role of current windows login user



One other question.

This was on a "skills test". The time has passed, and I'm not interested in
seeing any code. Just trying to make sense of this.

One of the requirements was to "display the role of the current logged in
user".

This was the test from the tech. manager. Unless it's a typo, shouldn't it
be role(s)?

Thanks.
"Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx> wrote in message
news:%23830pafGGHA.3976@xxxxxxxxxxxxxxxxxxxxxxx
>
> "Mark White" <markw2927@xxxxxxxxx> wrote in message
> news:%23sQsM2XGGHA.1452@xxxxxxxxxxxxxxxxxxxxxxx
> | Hey everyone
> |
> | I'm having a great deal of problems finding this information through
> google
> | and yahoo, so I turn to you on this.
> |
> | I have a Windows app running on XP. I am able to caputre the user's
Name
> | property in the WindowsPrincipal's IIdentity interface.
> |
> | Where can I find the role that the user is assigned for the current
login?
> | I only want the one role which is assigned for the current user, not all
> of
> | the groups in which the user belongs (that is working fine).
> |
> | Do I have to actually test out permissions on files/objects to find the
> | current role/group? Seems to be a lot of work going that route for
> | something which should be accessible in the same interface as Name. Why
> | isn't it?
> |
> | I'm on 1.1 btw. Has this changed in 2.0?
> |
> | Thank you in advance for any help you can give me.
> |
> | Mark White
> |
> |
>
> Roles are not meant to check/control resource access permissions, they are
> meant for program access/flow control. These are totally different things.
>
> if(myPrincipal.IsInRole("Sales"))
> {
> // Do whatever "Sales" is allowed to do, initialize the UI etc...
> }
> else
> if((myPrincipal.IsInRole("AccountManagers"))
> // do whatever "AccountMAnagers" are allowed to do.
>
> Resources like file and directory object permissions are checked when a
user
> opens the resource, this is the task of the OS and (in general) not the
task
> of an application program. Note that V2.0 includes managed classes that
> wraps the object security access API's in Win32 by means of
> System.Security.AccessControl classes, v1.1 user can achieve the same
using
> System.DirectoryServices and some ADSI stuff or by using the
> System.Management and WMI classes.
>
> Willy.
>
>


.



Relevant Pages

  • Re: Role of current windows login user
    ... Roles are not meant to check/control resource access permissions, ... meant for program access/flow control. ... Resources like file and directory object permissions are checked when a user ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Role of current windows login user
    ... my knowledge of the actual plumbing underneath permissions ... > Roles are not meant to check/control resource access permissions, ... > meant for program access/flow control. ...
    (microsoft.public.dotnet.languages.csharp)
  • Resource-based security with IPermission?
    ... The permissions should be assigned to the resource and the ... So I looked into extending the PrincipalPermission. ... GrantedPermissions, this is easy enough, however I wondered how or if ...
    (microsoft.public.dotnet.security)
  • Re: Resource reservation problem
    ... I have set up permissions in the EXCHANGE GENERAL tab, ... I am positive the request is not directly made on the resource calendar. ...
    (microsoft.public.outlook.calendaring)
  • Re: AD group logon script question
    ... Once these "resource permission groups" are created ... NOT by modifying permissions on the resource. ... only global groups, and they are not members of any ... represent everyone authorized to use application XYZ. ...
    (microsoft.public.scripting.vbscript)