|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
xml based AzMan and ActiveDirectoryI'm using xml based AzMan (I'm on Win XP) and Active Directory users. I want to be able to know if a user belongs to a certain role from an app. If I'm doing like in the code below, I'm not capable to see in the windows principal the roles defined in the .xml AzMan file. IAzApplication iapp = this.store.OpenApplication(appName, null); ArrayList al = new ArrayList(); WindowsPrincipal wp = (WindowsPrincipal)System.Threading.Thread.CurrentPrincipal; foreach (IAzRole appRole in iapp.Roles) { if (wp.IsInRole(appRole.Name)) { return true; } } How can I load in the WindowsPrincipal the AzMan roles ? Or how can I check directly (using the AzMan library) if a user belongs to a role / app. ? Thank you, Alina Hello A,
can you please clarify what you want to achieve? --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > Hello > > I'm using xml based AzMan (I'm on Win XP) and Active Directory users. > I want > to be able to know if a user belongs to a certain role from an app. > If I'm doing like in the code below, I'm not capable to see in the > windows > principal the roles defined in the .xml AzMan file. > IAzApplication iapp = this.store.OpenApplication(appName, null); > ArrayList al = new ArrayList(); > WindowsPrincipal wp = > (WindowsPrincipal)System.Threading.Thread.CurrentPrincipal; > foreach (IAzRole appRole in iapp.Roles) > { > if (wp.IsInRole(appRole.Name)) > { > return true; > } > } > How can I load in the WindowsPrincipal the AzMan roles ? Or how can I > check directly (using the AzMan library) if a user belongs to a role / > app. ? > > Thank you, > Alina Hello
I want to check is the user "X" is in the role "Y" in the application "Z" or if the user "X" is in any of the roles of the application "Z" the roles being defined in the xml file (by AzMan as interface). Thank you, Alina Show quoteHide quote "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com> wrote in message news:42565460e2c168c7883af6b536e8@news.microsoft.com... > Hello A, > > can you please clarify what you want to achieve? > --------------------------------------- > Dominick Baier - DevelopMentor > http://www.leastprivilege.com > >> Hello >> >> I'm using xml based AzMan (I'm on Win XP) and Active Directory users. >> I want >> to be able to know if a user belongs to a certain role from an app. >> If I'm doing like in the code below, I'm not capable to see in the >> windows >> principal the roles defined in the .xml AzMan file. >> IAzApplication iapp = this.store.OpenApplication(appName, null); >> ArrayList al = new ArrayList(); >> WindowsPrincipal wp = >> (WindowsPrincipal)System.Threading.Thread.CurrentPrincipal; >> foreach (IAzRole appRole in iapp.Roles) >> { >> if (wp.IsInRole(appRole.Name)) >> { >> return true; >> } >> } >> How can I load in the WindowsPrincipal the AzMan roles ? Or how can I >> check directly (using the AzMan library) if a user belongs to a role / >> app. ? >> >> Thank you, >> Alina > > Hello A,
i used the following code private string[] getRoles(IAzClientContext context) { object[] a; try { a = (object[]) context.GetRoles(""); } catch (COMException ex) { throw new AzMethodException(ex, "IAzClientContext.GetRoles"); } string[] roles = new string[a.Length]; Array.Copy(a, roles, a.Length); return roles; } i implemented a AzManPrincipal - and the code you see is part of the IPrincipal.IsInRole method you can read more here, too: http://www.leastprivilege.com/SearchView.aspx?q=azman --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > Hello > > I want to check is the user "X" is in the role "Y" in the application > "Z" > or if the user "X" is in any of the roles of the application "Z" > the roles being defined in the xml file (by AzMan as interface). > Thank you, > Alina > "Dominick Baier [DevelopMentor]" > <dbaier@pleasepleasenospamdevelop.com> wrote in message > news:42565460e2c168c7883af6b536e8@news.microsoft.com... > >> Hello A, >> >> can you please clarify what you want to achieve? >> --------------------------------------- >> Dominick Baier - DevelopMentor >> http://www.leastprivilege.com >>> Hello >>> >>> I'm using xml based AzMan (I'm on Win XP) and Active Directory >>> users. >>> I want >>> to be able to know if a user belongs to a certain role from an app. >>> If I'm doing like in the code below, I'm not capable to see in the >>> windows >>> principal the roles defined in the .xml AzMan file. >>> IAzApplication iapp = this.store.OpenApplication(appName, null); >>> ArrayList al = new ArrayList(); >>> WindowsPrincipal wp = >>> (WindowsPrincipal)System.Threading.Thread.CurrentPrincipal; >>> foreach (IAzRole appRole in iapp.Roles) >>> { >>> if (wp.IsInRole(appRole.Name)) >>> { >>> return true; >>> } >>> } >>> How can I load in the WindowsPrincipal the AzMan roles ? Or how can >>> I >>> check directly (using the AzMan library) if a user belongs to a role >>> / >>> app. ? >>> Thank you, >>> Alina Thank you
Show quoteHide quote "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com> wrote in message news:42565460e2c928c78845f6c43b48@news.microsoft.com... > Hello A, > > i used the following code > > private string[] getRoles(IAzClientContext context) > { > object[] a; > try > { > a = (object[]) context.GetRoles(""); > } > catch (COMException ex) > { > throw new AzMethodException(ex, "IAzClientContext.GetRoles"); > } > string[] roles = new string[a.Length]; > Array.Copy(a, roles, a.Length); > return roles; > } > > i implemented a AzManPrincipal - and the code you see is part of the > IPrincipal.IsInRole method > > you can read more here, too: > http://www.leastprivilege.com/SearchView.aspx?q=azman > > --------------------------------------- > Dominick Baier - DevelopMentor > http://www.leastprivilege.com > >> Hello >> >> I want to check is the user "X" is in the role "Y" in the application >> "Z" >> or if the user "X" is in any of the roles of the application "Z" >> the roles being defined in the xml file (by AzMan as interface). >> Thank you, >> Alina >> "Dominick Baier [DevelopMentor]" >> <dbaier@pleasepleasenospamdevelop.com> wrote in message >> news:42565460e2c168c7883af6b536e8@news.microsoft.com... >> >>> Hello A, >>> >>> can you please clarify what you want to achieve? >>> --------------------------------------- >>> Dominick Baier - DevelopMentor >>> http://www.leastprivilege.com >>>> Hello >>>> >>>> I'm using xml based AzMan (I'm on Win XP) and Active Directory >>>> users. >>>> I want >>>> to be able to know if a user belongs to a certain role from an app. >>>> If I'm doing like in the code below, I'm not capable to see in the >>>> windows >>>> principal the roles defined in the .xml AzMan file. >>>> IAzApplication iapp = this.store.OpenApplication(appName, null); >>>> ArrayList al = new ArrayList(); >>>> WindowsPrincipal wp = >>>> (WindowsPrincipal)System.Threading.Thread.CurrentPrincipal; >>>> foreach (IAzRole appRole in iapp.Roles) >>>> { >>>> if (wp.IsInRole(appRole.Name)) >>>> { >>>> return true; >>>> } >>>> } >>>> How can I load in the WindowsPrincipal the AzMan roles ? Or how can >>>> I >>>> check directly (using the AzMan library) if a user belongs to a role >>>> / >>>> app. ? >>>> Thank you, >>>> Alina > >
Importance of salt
Anonymous access + Windows Authentication Custom Security Permission & Security Attribute troubles RSACryptoServiceProvider X.509 "Bad Key" error - EnvelopedCms.Decrypt() Strong Names Secure??? Windows authentication only Sending raw sockets without administrative privileges? Windows Security pops up when executing javascript in an asp.net p .NET 2.0: code access security / authentication |
|||||||||||||||||||||||