|
| how to add new access rules without go to web admin tools |
 |
Tue, 1 Apr 2008 12:41:45 +0000 |
Hello,
i need help with the problem when i add new users on my website using create
user wizard, how can i add assign new acces rules to that user without go to
asp.net web admin tools. i want all new user to be assign new access rules for
specific folder they can access. what is the codes?. tQ
|
| Post Reply
|
| Re: how to add new access rules without go to web admin tools |
 |
Wed, 2 Apr 2008 05:32:56 +0000 |
is there any conntrol that will help me to set up access rules for the site
folders without using web admin tools like login control, create user wizard?.
please help.!
|
| Post Reply
|
| Re: how to add new access rules without go to web admin tools |
 |
Thu, 3 Apr 2008 07:15:44 +0000 |
Hi
This article explains how to implement Your Own Website Administration Tool
http://aspnet.4guysfromrolla.com/articles/053007-1.aspx
custom Website Administration Tool's role management performs the following
three tasks:
Displays the roles currently in the system,
Allows an existing role to be deleted, and
Enables new roles to be added to appropriate folder This response contains a
reference to a third party World Wide Web site. Microsoft is providing this
information as a convenience to you. Microsoft does not control these sites and
has not tested any software or information found on these sites; therefore,
Microsoft cannot make any representations regarding the quality, safety, or
suitability of any software or information found there. There are inherent
dangers in the use of any software found on the Internet, and Microsoft cautions
you to make sure that you completely understand the risk before retrieving any
software from the Internet.
Hope it helps
|
| Post Reply
|
| Re: how to add new access rules without go to web admin tools |
 |
Thu, 3 Apr 2008 09:45:38 +0000 |
There is a great set of security tutorials on this site at
www.asp.net/learn/security
check them out
|
| Post Reply
|
| Re: how to add new access rules without go to web admin tools |
 |
Thu, 3 Apr 2008 22:40:57 +0000 |
here you go
ProtectedSub CreateUserWizard1_CreatedUser(ByVal sender AsObject, ByVal e As
EventArgs) Handles CreateUserWizard1.CreatedUser
TryDim UserNameTextBox As TextBox =
CreateUSerWizardStep1.ContentTemplateContainer.FindControl("UserName")
Dim DataSource As SqlDataSource =
CreateUSerWizardStep1.ContentTemplateContainer.FindControl("InsertExtraInfo
")Dim User As MembershipUser = Membership.GetUser(UserNameTextBox.Text)
Dim UserGUID AsObject =
User.ProviderUserKeyDataSource.InsertParameters.Add("UserId",
UserGUID.ToString())
DataSource.Insert()
'Add Dealer to all PrincipalDealer
roleRoles.AddUserToRole(CreateUserWizard1.UserName, "SuperAdmin")
Roles.AddUserToRole(CreateUserWizard1.UserName,
"Admin")Roles.AddUserToRole(CreateUserWizard1.UserName,
"Users")
Catch
EndTry
EndSub
Enjoy~
in2minds
|
| Post Reply
|
|
|
|
|
|
|
|
|
|