Losing User Roles?

Aug 11, 2010

I am baffled, I am using a treeview to set the source of an iframe. The web page is being displayed correctly, but User.IsInRole("roleName"), in the code behind, always returns false. The strange thing is User.Identity.Name returns the correct user name. I have tried setting the target of the tree view nodes to "_blank" and to "_self" and still no luck. So, it doesn't appear that the problem is related to the iframe.Before the treeview was added, javascript was used to set the source for the iframe and User.IsInRole returned the correct values.

View 4 Replies


Similar Messages:

How To Make All Of The Roles Defined In RoleGroup> Required? (i.e. User Must Meet All Roles)

Feb 24, 2011

Let's say I have a rolegroup as follows:

<asp:LoginView ID="lvDoSomeStuff" runat="server">
<RoleGroups>
<asp:RoleGroup Roles="RoleOne,RoleTwo">
<ContentTemplate>
...
</ContentTemplate>
</asp:RoleGroup>
</RoleGroups>
</asp:LoginView>

Is there a way I can make it so that a user must meet RoleOne and RoleTwo to satisfy the RoleGroup? By default, if a user is in either of the two roles, they will be granted access. I know I can do this via the code-behind, but I'd prefer to be able to wrap some content template with this markup instead of having to wrap it in a panel and hide the panel programmatically.

View 1 Replies

C# - User Control Losing State

Jun 27, 2010

I have a user control that I am explicitly calling from an aspx page. In page_load of the aspx page I have the following: myControl = (DynamicTable)Page.LoadControl("../inc/DynamicTable.ascx");

Then in my code where I want it to execute the control, I have this: pnlESDDEnrolled.Controls.Add(myControl);

where pnlESDDEnrolled is the panel I am loading it into for display. So, I execute the aspx page, it links off to the user control, populates the control, returns back to the aspx page and the page displays with the user control in the middle of it. All is well.

The problem comes in when updates are made on the user control. Keep in mind, that other data is updated on the page as well, and the update button resides on the page, not the control. Anyway, when the update button is pushed, the button_click event is fired on the page, but the updates that I made on the user control are lost. Since the page loaded the user control and then the usercontrol executed the page unload method, the page has no knowledge of the user control anymore. Thus, when the update button on the page is pushed, I guess I am not really sure what happens with the updated data on the user control. All I know is that it is lost.

View 2 Replies

User Controls :: Save And Retrieve CheckBoxList Values As Per User Roles?

Feb 26, 2014

i need a script on ASP.net that can build this form.

1.Users === Drop Down Menu then in the Drop down should be the names of all Taafoo staff.

View 1 Replies

Is It Possible To Recycle IIS Application Pools Without Losing User Sessions

Nov 25, 2010

We're currently deploying code to live pretty reguarly at the moment, but the down side is destroying user session data.

Is there a way of being able to recycle IIS without loosing session data, or is persisiting session state in SQL server or alike the only way?

View 2 Replies

Web Forms :: Create Unlimited User Control Without Losing The Data

Dec 28, 2010

how to create unlimited user control without losing the data... My problem is on postback.. i searched a lot but m not get solution.. my question is how to recreate unlimited controls(textbox,dropdown) and how to maintain the data in the controls.. Now am able to create dynamic usercontrol (unlimited) when Button click event using for loop but not able to maintain the data during postback.

View 1 Replies

User Controls :: How To Set User Roles During Registration

May 7, 2015

In Below link show to how to Imaplement role based security, Page access and show / Hide Menu items based on Role in asp.net

[URL]

But My Questions is How to Register Admin and Client user?

View 1 Replies

Can User Have More Than One Roles

Apr 3, 2010

I'm developing a web application I want to use the role authentication to control different parts of the website accessibility. But my problem is say I implemented a upload and download functionality on one of the page and I want to have the ability to control a user whether they can either upload or download; or both. So, I'm not exactly sure if the role base authentication can support a user with more than one role to work the way I want it.

View 1 Replies

How To Add .net User .net Roles For Application From IIS

Sep 6, 2010

I am not sure is there any other way to add User for my application othe than using Asp.net Website admistration tool??

View 1 Replies

User Controls :: Implement Custom User Login With Roles Without Using Login Control

May 7, 2015

What if, I'm not using the LOGIN CONTROL but rather creating a Custom Control for Login. Is it possible to have user roles and a site map that redirects to its own destination when the user login?

View 1 Replies

Security :: How To Assign Two Roles For One User

Jan 11, 2010

Im now in assigning a roles to a user. But, 1 of my user wants me to assign 2 roles for him.. The situasion is like this :

I have a few roles which are :

- zone head

-zone officer

-clerk

The problem is now 1 person can be assign for 1 role only..

How can i assign 2 roles for 1 user..

View 4 Replies

Security :: Adding User To Certain Roles?

Aug 24, 2010

I have setup ASP security in my application. I used the following tutorial, just wondering if someone can tell me how i can setup this up to allow the creation of a user?

http://weblogs.asp.net/scottgu/pages/Recipe_3A00_-Implementing-Role_2D00_Based-Security-with-ASP.NET-2.0-using-Windows-Authentication-and-SQL-Server.aspx

where to find or what to search on to find some example of how to add the option for adding users?

I have the above setup and its working, but only because of the accounts i created with my global.asax file.

I need to give the admins access to add a new user. Currently i can search on existing users and update them, but need to add the ability to add a new user.

View 4 Replies

Faking User Roles In Sitecore 6.2?

Jun 17, 2010

The Faking User Roles document in SDN appears to give exactly what I need. I have a few "roles" that I have access to through stored procedure calls I don't control, read-only, via a CRM I don't have direct access to.

Unfortunately, I can't find the method AddRole, or even the class UserItem, by its present name. Does this functionality exist in Sitecore 6.2? If so, where is it?

View 4 Replies

Security :: Showing An User's Roles?

May 8, 2010

I'm trying to show a user's roles in a label but here's what I get when I view the page in the browser:

[IMG]http://i887.photobucket.com/albums/ac76/scoobymadterry/teamadminpage.jpg[/IMG]

As you can see instead of the roles, System.String[] shows in the label. How can I get the roles instead of that?

View 4 Replies

Security :: How To Direct User When Login By Roles

Jan 27, 2011

How to Direct Users to specific Page By roles?

View 10 Replies

How To Assign Roles To User While Creating Their Account

Jul 26, 2010

i am using asp.net built-in membership and role provider.

In my application Admin Create account for user.

currently i am assigning roles by going to asp.net configuration website.

kindly tell me how to add an extra step of Select Role in creat user account API.

View 2 Replies

Security :: How To Set A Role Of User Having Multiple Roles

Mar 5, 2010

This is my senario. I want user to login and if "LoggedIn" User has more than one role then it displays the list of radio buttons. After selection of the role user gets further privilages according to the role that he has selected.

I've a problem setting up the role. And user can change his role when ever he wants.

For Example "john" is the user having two roles "Account Manager" and "Project Manager".

View 3 Replies

Security :: Adding Domain User Roles To A Web App?

Jun 18, 2010

I want to make my domain administrators the administrators to my web application so that they are the only ones that can change content. All other users would simply be able to read the material. I am relatively new to web apps and I can not seem to find what I am looking for anywhere on the net.

View 2 Replies

Security :: Use Or Store Roles For Add A New User Or Update?

Jul 2, 2010

Ive been exploring the tabls in the membership database to see how they are structured. If i add a new user or update an existing one i see it in the user and membership tables. But i dont understand how to use or store roles. I use the ASP.NET CONFIGURATION toll in the WEBSITE menu to create roles and create access rules, but those roles dont show up in the Roles table in the db!

Yet the roles are stored cause they keep apearing in the ASP.NET CONFIGURATION. How weird is not that? Where is it stored and how can i access it? I need to programatically check if the user who is logged in is in a certain role.

View 8 Replies

C# - Extend AuthorizeAttribute And Check The User's Roles?

Feb 25, 2011

I am busy writing my own custom attribute for my action method called MyAuthorizeAttribute, I am still busy writing the code, here is my partial code:

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public class MyAuthorizeAttribute : AuthorizeAttribute
{
public new Role Roles;
public override void OnAuthorization(AuthorizationContext filterContext)
{
base.OnAuthorization(filterContext);
if (Roles != 0) // Did it this way to see what the value of Roles was
return;
// Here I am going to get a list of user roles
// I'm doing my own database calls
filterContext.Result = new HttpUnauthorizedResult();
}
}

Here is my Role enum:

public enum Role
{
Administrator = 1,
SuperAdministrator = 2
}

My action method:

[MyAuthorize(Roles = Role.Administrator|Role.SuperAdministrator)]
public ActionResult Create()
{
return View();
}

The reason why I did not use Roles = "Administrator,SuperAdministrator" was because the roles are hard-coded. I don't want to have a 100 places to change if the role name changes.

Given my method, when it gets to if (Roles != 0) then Roles total value is 3, how would I check to see if these 2 roles is in the list of user roles for a specific user?

Am I doing it correct here? If not how would I otherwise implement this? It doesn't have to be the way that I did it in.

View 2 Replies

Hide ActionLinks Based On User Roles?

Jul 8, 2010

In a standard, generated list view, how can I hide certain ActionLinks based on the roles the logged in user belongs to?

View 1 Replies

Security :: Create User Wizard With Roles?

Dec 31, 2010

I'm trying to add a step into a Create User Wizard to set roles, but it don't works, it create the user but don't set the role,

[Code]....

using System;

View 1 Replies

Security :: Block User Without Using Roles Or Membership?

Mar 20, 2010

have a project where there are main 3 types of users i have to block them from accessing other pages but without using roles or membership is there any other way to do the same?

View 3 Replies

Web Forms :: Set Roles To A Particular User Dynamically Using Membership?

Sep 7, 2010

I have used asp.net membership and roles in my application. Its working fine.

I have an (.aspx page) where i have placed create user wizard, to create new user dynamically.

The same way i have created roles in my application.

What my requirement is, how to set roles dynamically to a particular user from my (aspx page).

View 2 Replies

User Permissions On Certain Views Based On Roles?

Feb 23, 2011

I am using ASP.NET MVC 3. We assign roles to certain people at work, then we use Windows authentication to determine what roles a user has. Lets say the roles are RoleA, RoleB and RoleC. So now I get a list of roles for a user. Lets says that UserA belongs to RoleA and RoleB. Some of my views need to be authenticated as not everyone can view certain views. Lets say that ViewA can only be viewed by users that belong to roles RoleA and RoleB. How would I do this? What would I need to look into? When a user that does not belong to these roles tries to access the views then he/she should be redirected to an error page.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved