|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
How does "IsInRole" really works?
Originally posted by : Shell (shell_wang@hotmail.com)Is there any requirement about the table which store the information about the roles and users? Otherwise, how can the IsInRole method get to know which table it should look into to check the user's role? Or there is some class to implement some class?thanks!
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : Kerry Whelan (whelan_kerry@hotmail.com)</b></i><br /><br />Set the GenericPrincipal with a string array of groups that the user belongs to, from your table.<br /><br />IsInRole takes a string role and if the current GenericPrincipal is a member of that role it returns "TRUE".<br /><br />Hope this helps,<br /><br />Kerry
|
|
#3
|
|||
|
|||
|
<i><b>Originally posted by : shell (shell_wang@hotmail.com)</b></i><br /><br />But the .NET still need a way to decide whether this user belongs to this string role. That means it has to have a table in DB or something else to store the relationship between user and role. What table does it use? <br /><br />------------<br />Kerry Whelan at 2/20/2002 12:53:56 AM<br /><br /><br />Set the GenericPrincipal with a string array of groups that the user belongs to, from your table.<br /><br />IsInRole takes a string role and if the current GenericPrincipal is a member of that role it returns "TRUE".<br /><br />Hope this helps,<br /><br />Kerry
|
|
#4
|
|||
|
|||
|
<i><b>Originally posted by : </b></i><br />If you are using GenericPrincipals you tell .NET what groups the user belongs to. This is done with the string array. You set up the roles in the principal and then question the role in the IsInRole.<br /><br />If you want to use Windows Roles you can use IsInRole(WindowsBuiltInRole.Administrator)<br /><br />Kerry<br />
|
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > How does "IsInRole" really works? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|