Is there a default role for a new user?

Hi

Simple really – when a new user registers via the CreateUserWizard web control, are they assigned to a role? Is there a way of setting this? What’s the default?

Thanks in advance
Richard

0
RichardLaw
1/22/2007 3:58:12 PM
asp.net.security 27051 articles. 1 followers. Follow

2 Replies
639 Views

Similar Articles

[PageSpeed] 2

no roles are assigned by default.  You'd want to add the role in the createduser event, something like this:

<%

@ Page Language="C#" %>

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<

script runat="server">

protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)

{

Roles.AddUserToRole(CreateUserWizard1.UserName, "Guest");

}

</

script>

<

html xmlns="http://www.w3.org/1999/xhtml" >

<

head runat="server">

<title>Untitled Page</title>

</

head>

<

body>

<form id="form1" runat="server">

<div>

<asp:Repeater ID="Repeater1" runat="server">

</asp:Repeater>

<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" OnCreatedUser="CreateUserWizard1_CreatedUser">

<WizardSteps>

<asp:CreateUserWizardStep runat="server">

</asp:CreateUserWizardStep>

<asp:CompleteWizardStep runat="server">

</asp:CompleteWizardStep>

</WizardSteps>

</asp:CreateUserWizard>

</div>

</form>

</

body>

</

html>
Peter Kellner
http://73rdstreet.com and blogging at
http://PeterKellner.net
MVP, ASP.NET
0
pkellner
1/22/2007 4:34:57 PM
Many thanks - works a treat!
0
RichardLaw
1/25/2007 10:08:20 AM
Reply:

Similar Artilces:

Creating User Account Without Default Security Role (Registered User Role)
  My DNN version is 3.1.1. The portal is set to Private Registration. Unauthenicated users have access to the basic pages of the site. We require my company's current customers to register and be approved to have access to all other pages that contain information restricted to them (the major part of the site). As you know, authorizing a user account applys the Registered User security role by default and this is how I control access to the customer areas.  We want to create a page that will be used by Marketing to allow potential customers by login to...

Default role for new users
 is there a way to set up a default role for new registrations? Example assign them automatically to the "Members" role? How about like this? protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e) { Roles.AddUserToRole(CreateUserWizard1.UserName, "Members"); }Thanks, EdMicrosoft MVP - ASP/ASP.NET ok. will try that. thanks.:)Dot Net Rocks!!! ...

How to set a default role for new users?
Sorry if this question has been asked before but I was unable to find it. How do I assing a default role like "guest" to new users? I am using the CreateUserWizard to let new members enter their information. If you look at the starter kits, (like the club starter kit) they automatically create the roles in the global.asax file in case they are not there. Then, in the createuserwizard's "CreatedUser" event, you add code that assigns the role to the current user. something like: Roles.AddUserToRole(CreateUserWizard1.UserName, AvailableRoles.Items[i].Value);    http://weblogs...

How is the default Role for a new registered user set?
I've been digging through the C# Personal Site Starter Kit code, and I cant seem to figure out how it assigns roles to new users. How is this determined?And how would one configure this?thanks It doesn't add roles to users, you do. Go to the file menu in VWD and select Website -> ASP.NET Configuration. You will then be presented with a web site where you can add roles, users, approve users, and add users to roles. Alternatively you can add some code to the registration page that adds the registered users to the "Friends" role. You will have to set the CreateUserWizard property of "Dis...

Add New User to Default Role During Sign-Up
I have a role called GUEST and like to automatically make all new sign-ups belong to this role. How do I do that, where would I change/add the code within the Personal Starter Kit? Dirk In the register page open the code window and there is an event for the CreateUserWizard1 called CreatedUser you need to implement this event and in there place the following code: Roles.AddUserToRole(CreateUserWizard1.UserName, "Guest") Unless the CreateWizard has some kind of property to set a default role to a user that I am missing or some setting in the web.config? - Will- WilliamPlease mark the mo...

Login controls
HiI'm building a web app in visual studio 2005 and I'm setting up a 'create user' page for the admin part of the app. I'm creating a customised CreateUserWizard so that I can add a user to the asp.net membership list (in database on my server) and also add some info to one of my tables (user first name, faculty they work for etc).  I want to be able to let the admin user allocate roles (those already defined in my config) from a drop down list. I want to inculde this in my create user wizard, and have an 'update user' section where I can change their role the...

create a default role for all new users (self-created registrations)
Hello, Is there a way to set a default role with the createuserwizard control? I only have 2 roles, and I want all content other than the admin folder to be available to anyone who is not anonymous. (If the search was working on this site I probably would find what I am looking for... thanks!)     From Object browser I found this and tried to implement it like the following:     Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser       ...

3.0.11
I've noticed with the default install new users get the 'Subscriber' role in addition to the 'Registered User' role. Is this correct? Should the 'Subscriber' role be reserved for paying users (and not be default), if not why do you need both?DNNDesigner - Free Editor, Free Compact Control Panel, Free Designer Objects and 60+ Skins From Only $1...

Cannot open user default database. Login failed. Login failed for user 'DOMAIN\User'. (.Net SqlClient Data Provider)
Hi when i try and open a database in sql server management studio i get the error "Cannot open user default database. Login failed. Login failed for user 'DOMAIN\User'. (.Net SqlClient Data Provider)", what can i do to rectify this, i have googled around and still havent found no answers. Which authentication mode is your Sql Server configured - MixedMode, Windows Authentication or Sql Server Authentication? Please refer to http://msdn2.microsoft.com/en-us/library/ms366351.aspx and http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx    Ple...

Why is 'users' is the default group for new users in openSUSE?
I am new to openSUSE. In other Linux distros I've used, new users are assigned to their own group (i.e. user 'joe', group 'joe') by default. To my surprise, when I create new users with my openSUSE 11.4, they are all assigned to the 'users' shared group by default. To test this, I created a new user called 'friends'. From my terminal, I can see how the new user files look like: joe@linux:~> ls -l /home/friends/ total 40 drwxr-xr-x 2 friends users 4096 Sep 3 11:37 bin drwxr-xr-x 2 friends users 4096 Sep 3 11:38 Desktop drwxr-xr-x 2 friend...

creating a new role that is not an Administrator, but users can create new pages
My organization is migrating to DNN version 3 for its Internet site. We will have various people (about 40) throughout the organization designated as content managers, who will create pages for their units. I tried creating a new role called 'Content Manager' in DNN, but as far as I can see, unless I designate these people as Administrators, they won't have access to create new pages - the icon bar at the top for creating and editing pages only appears for Administrators and SuperUser. I'm a programmer, so I did some extensive digging into the code, and it appears that this is really hard-wi...

Default user role
When ever I use the CreateUserWizard on my website the new user is not apart of any roles that I have set up so it gives him power to do anything. How do I set the default role for all new users?   thanks.  From here:   This is done by handling CreatedUser event of the CreateUserWizard control.protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e) { Roles.AddUserToRole(CreateUserWizard1.UserName, "NormalUsers"); }Darrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it helped you! Thanks. That works well....

Default user role
Hello all, What is the default user role of a new user? /Treg The role of a new user depends on the mode how he is registered: - if the user registers himself with REGISTER, the role is NULL. That means the user has no role and is 'anybody'. The only advantage for the registered user at this moment is, that the SIGNON-Dialog is hidden. To add some advantages to the user, You must assign the user to a role within the admin-task and assign access/edit of some desktop-modules to the role. - You may directly register a new user within the admin-task and a...

allow registered users of a site, to create new users and manage their roles and passwords etc
Hi Hi All Im looking for a solution which will allow registered users of a site, to create new users and manage their roles and passwords etc, so that the registered primary user becomes an administrator for the other users they create.   In short, I am not good enough to create this my self, so if anyone knows of an off the shelf solution that  exists, or what this type of thing is know as so I can find it via a web search, I’d be most grateful as I’m not having much luck so far   Thanks   odxsigma   Hello yes , there is somethi...

Web resources about - Is there a default role for a new user? - asp.net.security

Credit default swap - Wikipedia, the free encyclopedia
Sovereign credit default swap prices of selected European countries (2010-2011). The left axis is basis points, or 100ths of a percent; a level ...

INFOGRAPHIC: The History Of Facebook's Default Privacy Settings
INFOGRAPHIC: The History Of Facebook's Default Privacy Settings

Secure browsing by default
We now use https by default for all Facebook users. This feature, which we first introduced as an option two years ago , means that your browser ...

北方理財團隊的家園:http://group.hexun.com/m132312/default.html外汇交易员芬芳fenfang恭候您! - 芬芳FENFANG - 和讯博客
北方理財團隊的家園:http://group.hexun.com/m132312/default.html外汇交易员芬芳fenfang恭候您! - 芬芳FENFANG - 芬芳FENFANG的博客 - 和讯博客

Tab applications for musicians look to innovate after Facebook removes default landing function
... landing tabs. Most page applications have experienced significant drops in daily and monthly active users now that Facebook removed the default ...


Google AdWords Regional Targeting (Default for US) - Flickr - Photo Sharing!
Explore Tamar Weinberg's photos on Flickr. Tamar Weinberg has uploaded 4087 photos to Flickr.

[3DS] Bravely Default: AR (English Subs) - YouTube
Turn on Annotations For Subs -May redo them as real CC subtitles- ★EDIT☆ ☆上から撮影した映像はこちら ★The top view video is here http://www.youtube.com/w ...

Default password leaves tens of thousands of Optus cable subscribers at risk
When Alex* found flaw in his cable modem that allowed anyone to receive and make calls using his number, his jaw dropped.

Atlas Iron to halve debt with refinancing that ratings agencies say is a default
Atlas Iron will almost halve its debt under a refinancing plan, which will need shareholder approval.

Resources last updated: 1/2/2016 6:38:50 AM