roles

ASP.NET C# Add/Update User to Role

左心房为你撑大大i 提交于 2019-12-19 03:37:08
问题 Hi all I have a page that shows Accommodation info and then the UserID of the person that created that information in a DetailsView. I also have a button that should look at that that UserID and when clicked take that userID convert it to a username so that then I can use that username to change the persons role to a renter. However I am unsure using C# how I can grab the UserID from details view do the conversion and update the role. Any ideas? Mark @Tim Here is the code I have added: public

dynamically mapping roles to controllers in ASP.Net MVC

不问归期 提交于 2019-12-18 17:07:15
问题 I am currently hard coding the authorized roles in the filter in my MVC applications like so: [Authorize(Roles = "Administrator,Manager")] I'd like to eventually have a way to map the roles to each controller, so that the site admin can handle assigning what roles can perform each set of actions. string roles = DoSomethingToGetAllowableRoles(controllerName); [Authorize(Roles = roles)] I'm imagining that I need to have a database table that somehow keeps a listing of each controller, and then

Spring LdapAuthentication and Load roles from local database

青春壹個敷衍的年華 提交于 2019-12-18 17:05:15
问题 I have Spring Security configured to authenticate against LDAP server. <security:authentication-manager > <security:ldap-authentication-provider user-dn-pattern="uid={0}" /> </security:authentication-manager> After authentication I want to load roles from local database for the same user. How can I load local database roles using "ldap-authentication-provider"? If I add the second authentication provider as below: <security:authentication-manager > <security:ldap-authentication-provider user

ASP.NET Identity User and Roles in Multisite [closed]

怎甘沉沦 提交于 2019-12-18 13:36:54
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I am trying to create a permissions system in an ASP.NET MVC Application. I have been learning the newest Identity framework - here are my requirements: A set of Hierarchical Roles for each set of functionality. So, for instance, there might be the following roles: Inherit Reader

What are some good role authorization solutions used with Authlogic?

十年热恋 提交于 2019-12-18 13:27:45
问题 I am looking for a good role based authorization solution to use alongside Authlogic. Anyone have any good suggestions? Please list some pros and cons from your experience if possible please. 回答1: Acl9 works great with AuthLogic: http://github.com/be9/acl9/tree/master 回答2: At RailsConf, I saw a lightning talk on Lockdown and was very impressed. Anyone with a modest amount of db and rails experience can roll their own ACL system, but Lockdown looks nice because it tries to keep the permission

Creating a AuthorizeAttribute - what do I need to know?

北慕城南 提交于 2019-12-18 11:27:31
问题 Here are my requirements: I'll be adding users to N amount of roles; defined in a database. I need to protect each controller action with my authorize attribute. For example, the web application would check if the logged in user belongs to either of these two roles and if they do, I let them in. How can I tell the Authorize attribute to fetch the user roles from a database table I choose? [Authorize(Roles = "Admin, Technician")] public ActionResult Edit(int id) { return View(); } I've tried

Alter default privileges for a group role in PostgreSQL

时间秒杀一切 提交于 2019-12-18 11:04:53
问题 I have created two group roles in Postgres 9.2: one is called admins and the other is called readers . The idea is very simple: admins create tables and readers have read access to these tables. After granting privileges to both group roles everything worked as expected for exisintg objects. But now what about new objects? So after reading this post I altered the default privileges to grant SELECT privileges to readers for any new table that admins create: ALTER DEFAULT PRIVILEGES FOR ROLE

ASP.Net MVC 3 Redirect UnAuthorized User not to loginUrl

送分小仙女□ 提交于 2019-12-18 10:28:54
问题 i have a project using ASP.Net MVC3 and using membership for roles. i use authorize in every controller. eg: [Authorize(Roles = "Administrator")] public ActionResult Index(string q, int i) { return View(model); } if someone doesnt have role for administrator, then it will redirect to login page by default. how to change it,so it will redirect into Views/Shared/UnAuthorize.cshtml ? or maybe if someone doesnt have role for administrator, it will show message box (alert) ? thanks in advance. 回答1

Handling Multiple Roles in MVC - Action-based Accessibility

喜欢而已 提交于 2019-12-18 10:17:26
问题 I currently have a project that I seem to have ran into an issue regarding Roles and thought I would get some opinions on how to best handle the problem. The system will require editable, flexible roles that control not only the access of specific areas, but also the use of system functions (Adding Users, Editing Users, Viewing Reports etc.) The system currently allows users to have multiple roles, each of those roles has explicitly defined areas of access/actions, for example: Role A can

Create PostgreSQL ROLE (user) if it doesn't exist

本小妞迷上赌 提交于 2019-12-18 10:08:20
问题 How do I write an SQL script to create a ROLE in PostgreSQL 9.1, but without raising an error if it already exists? The current script simply has: CREATE ROLE my_user LOGIN PASSWORD 'my_password'; This fails if the user already exists. I'd like something like: IF NOT EXISTS (SELECT * FROM pg_user WHERE username = 'my_user') BEGIN CREATE ROLE my_user LOGIN PASSWORD 'my_password'; END; ... but that doesn't work - IF doesn't seem to be supported in plain SQL. I have a batch file that creates a