FAQ Database Discussion Community


IsUserInRole method is not working properly

asp.net-mvc-4,razor,user-roles,asp.net-roles
Following 'if' condition is not working i.e. Roles.IsUserInRole(User.Identity.Name,"teacher") is not returning anything (it is returning zero). what should I do to make it work? Requirement is to display different pages to users register as teacher and different pages to users register as student. @if (Request.IsAuthenticated && Roles.IsUserInRole(User.Identity.Name,"teacher"))//HttpContext.Current.User.IsInRole("teacher"))//User.IsInRole("teacher")) //Roles.IsUserInRole(User.Identity.Name,"teacher")) { <li>@Html.ActionLink("Quiz...

Roles.AddUsersToRoles() requires IDENTITY_INSERT is ON

c#,sql,model-view-controller,simplemembership,user-roles
Migrated from LocalDB to SQL Server. Trying to add role to user: if (!Roles.GetRolesForUser("admin").Contains("Admin")) Roles.AddUsersToRoles(new[] { "admin" }, new[] { "Admin" }); and catching this: An explicit value for the identity column in table 'webpages_UsersInRoles' can only be specified when a column list is used and IDENTITY_INSERT is ON. ...

'System.Web.HttpApplication.User' is a 'property' but is used like a 'type'

c#,asp.net-mvc,asp.net-mvc-3,roleprovider,user-roles
I am new to MVC3 and I am trying to implement customer user and role Authentication. I am able to validate the user using my custom database but now I want to use my custom roles out of the same table. I followed the instructions from this link below to...

Parse Users with Roles

ios,parse.com,acl,user-roles
I'm try to get my head around this concept of how best to implement this via Parse. Personal Training App A studio get the app to manage their clients and their trainers. Hence we have roles. The Studio Manager This user can look at all the data in the app,...

displaying navbar according to user roles and permisions laravel

php,laravel-5,user-roles
I am implementing user roles in laravel 5 and I want to update the navbar according to the user permissions. The default navbar has A, B, and C menus which redirect to the specific pages. Let's say that user 1 can view page A and B, while user 2 can...

Can't map roles to gropus using ibm-application-bnd.xml

websphere,jaas,user-roles
I'm trying to map user groups using ibm-application-bnd.xml. Put it into META-INF folder. On try to access secure page get next message: [08.05.15 17:42:21:242 MSK] 00000084 WebCollaborat A SECJ0129E: ... GET в null:/loginmodule/date/, Authorization failed, Not granted any of the required roles: user-role When I try configure it with ibm...

Why can't I add SQLUserAgentRole to “sa” user on msdb?

sql-server,user-roles,sql-job,sql-server-2014-express
I'm trying to schedule an sql query to run daily. For that I need (according to this) to use a user with the SQLUserAgentRole database role. So I've tried to add the SQLUserAgentRole to the "sa" user on the msdb database but I get the error 15405: Cannot use the...

Limit a Wordpress user to see only pages and posts

wordpress,security,user-roles
How to limit a WordPress user to see only pages and posts in his panel? I want other menus like Appearance, Plugins, Settings, ... be hidden to that user. How to do it? I've searched a lot about this, but most of the results are talking about limiting user to...

Properties files to control form inputs based on roles

jsf,jsf-2,resourcebundle,user-roles
The requirements of the application that I'm building demands that user roles are to be dynamic, they will be stored in the database, and they will also be mapped to functionalities (forms) of the application, also stored in the database. Restricting a role from accessing a specific page won't be...

Asp.net LoginView Rolegroups don't show elements

asp.net,webforms,roles,user-roles,loginview
I'm using rolegroups at my Site.Master masterpage with Web Forms template. When I log in with some admin user, the first page shows the admin role content fine, but when I refresh the page or goes to other page, the elements in Rolegroups disappear. Only the LoggedInTemplate are showed. Someone...