roles

Converting Single DB ASP.NET Site into MultiTenant - Membership and Roles Dilemma

喜夏-厌秋 提交于 2019-12-06 05:19:18
I'm in the process up changing a single SQL DB website (ASP.NET/VB.NET) into a multitenant app, where each client has their own database. In the old site, all the ASP roles, logins and providers pointed to the single database. Now we have multiple databases, I'm wondering what would the best architecture/techniques to use. There is one database that configures the tenants, such as the company name, various settings (that would normally be in a web.config) and the connection string to their tenant database. Should we have all the membership & role stuff in the single database that configures

Drupal: assign roles in user_save

谁都会走 提交于 2019-12-06 03:55:32
问题 I can't find a solution or right example for something that should be quite simple: assign a role to an user when creating it, this is what I'm trying: $edit = array( 'name' => $_POST['name'], 'pass' => $password, 'mail' => $_POST['email'], 'status' => 0, 'language' => 'es', 'init' => $_POST['email'], array(2 =>'authenticated', 4=>'my custom role') //as id and named in role db table ); user_save(NULL, $edit); The user is not being created, how can I do this? Thank you 回答1: You haven't named

Spring Security ROLE_ prefix no longer needed?

≡放荡痞女 提交于 2019-12-06 01:56:44
问题 I was investigating on how to create custom role prefix until I realized that it doesn't matter. As long as my role from my db matches something like: <security:intercept-url pattern="/person/myProfile/**" access= "hasRole('BlaBla')" /> And it is not example, in db I literally set up role BlaBla to test and it works. I don't like when I get different behavior - many people had problem of setting up custom prefix to create custom role. What happens in here and should I expect hidden rocks? I

Keycloak User Roles missing in REST API

耗尽温柔 提交于 2019-12-06 00:58:29
I would like to ask, if somebody knows, why there are no roles within the user details in REST ADMIN API request. I saw some posts dealing with this topic, but there were either no clear answer or they propose to use keycloak-admin-client, but that seems not very convenient. Maybe I need to map the roles in Admin console or use claims? Roles are one of the most important user attribute so whats the reason they are not retrieved as other user attributes?Any suggestion? Thanks GET /auth/admin/realms/{realm}/users { "id": "efa7e6c0-139f-44d8-baa8-10822ed2a9c1", "createdTimestamp": 1516707328588,

How to change Spring Security roles by context?

余生长醉 提交于 2019-12-06 00:15:04
问题 I want to know if its possible to set roles based on a selected category. In our app there are categories which contain articles. Now we have a role hierarchy like this: ROLE_ADMIN > ROLE_EDITOR > ROLE_USER . The problem is that a user might have different roles based on the currently selected category: user1 - cat1 - ROLE_USER user1 - cat2 - ROLE_EDITOR The categories are not static. New ones can be added and older deleted. Is it possible to achieve this using Spring Security? 回答1: From your

How can I change the ASP.Net MVC Login Redirect based on role?

戏子无情 提交于 2019-12-05 23:48:07
问题 I have the following code I've typed into the Account Controller in my MVC project and I am in both the administrator and manager roles. When I log in I get redirected back to my home index instead of being redirected to my AdminApp index. Any ideas where I'm going wrong in my code? [AcceptVerbs(HttpVerbs.Post)] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings", Justification = "Needs to take same parameter type as Controller

How to implement a role based user management system with ASP.NET MVC 4

僤鯓⒐⒋嵵緔 提交于 2019-12-05 23:44:13
Although I'm new to ASP.NET I have to implement a role based user management system for an ASP.NET MVC 4 application (Visual Studio 2010). Users have one or more of these roles: Admin, Manager, User. Based on the role users have access to different areas. There is a predefined table with users. I know that ASP.NET provides something to implement this requirement but I am confused by the information I get. Even though there is a lot of information I can't find an adequate documentation or blog post. Everything starts and ends somewhere else. There seem to be many different but similar solutions

attribute asks user to login instead of access denied?

微笑、不失礼 提交于 2019-12-05 23:11:20
问题 Updated: Thanks to the help here I've created the following solution: public class CustomAuthorize : AuthorizeAttribute { protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext) { // Returns HTTP 401 - see comment in HttpUnauthorizedResult.cs // If user is not logged in prompt if (!filterContext.HttpContext.User.Identity.IsAuthenticated) { base.HandleUnauthorizedRequest(filterContext); } // Otherwise deny access else { filterContext.Result = new

Symfony2: Storing users, roles, role hierarchy, and access controls in database

三世轮回 提交于 2019-12-05 20:59:46
问题 I've been working with Symfony (2.x) for the first time and I had some questions regarding the definition of roles, role hierarchy, and how they can be assigned to individual users. I was interested in storing the roles and role hierarchy in a database (rather than security.yml); however, I cannot find any documentation supporting this. Is this advisable? I was interested in having an admin module that can add new roles and define role hierarchies; however, having the admin module modify

How can I slice a string like Python does in Perl 6?

人走茶凉 提交于 2019-12-05 19:36:06
In Python, I can splice string like this: solo = A quick brown fox jump over the lazy dog solo[3:5] I know substr and comb is enough, I want to know if it's possible, However. Should I use a role to do this? How to slice a string Strings (represented as class Str ) are seen as single values and not positional data structures in Perl 6, and thus can't be indexed/sliced with the built-in [ ] array indexing operator. As you already suggested, comb or substr is the way to go: my $solo = "A quick brown fox jumps over the lazy dog"; dd $solo.comb[3..4].join; # "ui" dd $solo.comb[3..^5].join; # "ui"