View Complete Post
If i hard coded role=Manager on the specific SiteMap/Folder/Page/etc. I will have problem when the manager need to remove from access a specific page. I need to change the code ont eh page/SiteMap/Folder more move the file into another folder.
What i have in mind is to change the role to taks oriented. such as role=AddStock, Edit Stock, Delete Stock, Print DO, Add Sales, Edit Sales, Deleted Sales..... (but it will be many role for 1 user compare to just 1 as Manager)
Will this cause performance issues later when each user have 60 roles and if i have 20,000 user will it affect the application performance?
Otherwise any other option? to make it flexible.
I would like to secure any URL below the http://MyServer/Admins and limit it to a specific role.
In webforms it was straight forward. I just put a child web.config in the /Admin/ folder and add <authorization> <allow roles> tags to it.
How would be the equivalent technique in MVC?
I have all my code in my other post about checkboxlist issue, but it boils down to, once i find someone doing my search, it displays their permissions as checkboxes. But if i want to remove a permission and click update, the update doesnt seem to occur, if i search on myself, it returns me with my permissions already checked. I uncheck 1 permission, click update and the checkbox is checked again as the page posts. Original Post:http://forums.asp.net/t/1591337.aspx
My aspx page seems pretty simple:
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:TextBox ID="TxtUserName" runat="server" /><asp:Button ID="LookupBtn" runat="server" Text="Search" onclick="LookupBtn_Click" />
<asp:CheckBoxList ID="RoleList" runat="server" /><br />
<asp:button ID="UpdateBtn" text="Update" Visible="false" runat="server" onclick="UpdateBtn_Click" />
My update button event and update method:
I have been using the following tutorial and had to convert the code to C# for my project, now i cant get the code to work, im getting red line under the word "in" in the UpdateRolesFromList, i tried to add a datasource on page load for the checkboxlist like so RoleList.DataSource = PopulateRoleList(User.Identity.Name.ToString());
and gives me error saying cannot implictly convert type 'void' to 'object'
What am i missing, that when i load the page or even do a search it never displays the checkbox list as it shows in the tutorial?
protected void Page_Load(object sender, EventArgs e)
public void PopulateRoleList(string userName)
string roleNames = null;
string roleName = null;
roleNames = Roles.GetAllRoles();
foreach (string roleName_loopVariable in roleNames)
roleName = r
We have a web application using VS 2008, c#. We try to filter siteMap nodes based on security roles. We have our customized the mether GetRolesForUser() in RoleProvider class to determine a user's role. In this method, roles will be returned by querying an SQL Server database.
However, we found that each time a page was loaded/refershed, this GetRolesForUser() was called, and the database would be queried. This is too MUCH and expensive.
We thought the roles should be queried only once when a user logs in. After that, role info should be stored somewhere for this user, rather than query DB all the time.
Any ideas, reference paper, snipet,...,?
Thanks a lot!
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?
Can someone tell me 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.
I am new to MVC and am using MVCContrib and trying to use the Checkboxlist .My requirement is to display list of all available roles on create user page . I have dine as below .
In this case GetAllRoles method retuns string . How can I assign the "DataTextField","DataValueField" to make it work ?
Thanks in advance.
Currently I am storing my username and password (passwordFormat="SHA1") credientails in my web.config. I would like to figure out how to access them in an xml file that I have stored in my App_Data directory rather than the web.config file because I do not want my application restarting everytime I manually add a user (small list of 5 authorized users for the CMS section).
Here is what my web.config section looks like:
<authentication mode="Forms"> <forms name=".Administration" loginUrl="~/SiteAdmin/Default.aspx" defaultUrl="~/SiteAdmin/Administration/Default.aspx" protection="All" timeout="30" path="/" requireSSL="false" slidingExpiration="true" &n
I'm pretty new to development using Microsoft technologies.
I'm trying to build a portal kind of an application in asp.net, in which one of the functionality is letting people log in and upload their documents. The upload page is only accessible to registered users of the portal.
I would like to track the user uploaded files according to their userIds.
Is it possible to use the FileUpload Control and C# to fetch the current user id, create a directory with the same name(as that of userID) in the file system and upload the files( multiple file upload, if necessary) into it?
Also another admin page would have to be able to see the list of files uploaded by the specific user and download it if necessary.
Could anyone help me with this?
I'm also expecting alternate solutions to the problem.
Awaiting a response.
Thanks in advance