roles

Symfony 2 : Redirect a user to a page if he has a specific role

本小妞迷上赌 提交于 2019-12-21 06:02:03
问题 I have a little question. I want that wherever is the user on my website, if he have the role "ROLE_DEGRADE", he is redirected on a specific page. How I can do that, I have to use firewall ? I don't want to redirect the user to a form login, just to a simple page. I want that everywhere on my website, without put a "if role degrade..." everywhere, in all my controllers... Thanks for your help ;) 回答1: Something like this should do it ... Create a new listener : class AccessListener { private

Symfony 2 FOS UserBundle users doesn't get group's role

允我心安 提交于 2019-12-21 05:39:12
问题 I'm using FOS User Bundle to manage access to my app. As i need a group notion, i've implemented what i need as described in the doc group . Everything's fine for creating users and groups BUT when i'm logging in with a user, and trying to get his role, he has none but USER_ROLE. Here is my User use FOS\UserBundle\Entity\User as BaseUser; class RegistredUser extends BaseUser { /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @ORM

Getting a list of users with their assigned role in Identity 2

寵の児 提交于 2019-12-21 04:24:34
问题 I am stuck trying to get this output Id | Name | Role ---------------------------- 1 | John | Administrator ---------------------------- 2 | Mary | Manager ---------------------------- 3 | Sage | Editor ---------------------------- 4 | Hank | Manager I can make it work in LINQPad, but somehow I am unable to translate it to ASP.NET MVC. from u in Users from ur in u.Roles join r in Roles on ur.RoleId equals r.Id select new { Id = u.Id, Name = u.Name, Role = r.Name, } How do I LINQ that in ASP

Ansible: how to run a play with hosts with different passwords?

拜拜、爱过 提交于 2019-12-20 19:57:27
问题 I'm currently learning how to use Ansible. Right now, I've got a bunch of servers, both new and legacy, that have different logins or passwords or both. All have key access to run the plays. Here's what I started with. Example hosts file: # legacy and new have different logins (like root and deploy) [legacy] serv1 serv2 [new] serv3 serv4 # different has a different login and password altogether [different] serv5 So to keep things simple, I originally had a playbook run the equivalent of sudo

Symfony2: How to login using OAuth (HWIOAuthBundle) + custom roles (by default and loaded from DB)

岁酱吖の 提交于 2019-12-20 14:15:57
问题 Note: the questions are at the end of this text but I will explain in detail all the context for a better understanding. I'm developing a Symfony2 application consisting of 3 modules: Module for students -> Needs the role ROLE_STUDENT Module for teachers -> Needs the role ROLE_TEACHER Module for administrators -> Needs the role ROLE_ADMIN The role hierarchy is as follows: ROLE_TEACHER: [ROLE_STUDENT] ROLE_ADMIN: [ROLE_TEACHER] Therefore: A student (with ROLE_STUDENT role) only can access to

unable to add roles to user with meteor using 'roles' package

可紊 提交于 2019-12-20 09:36:56
问题 I'm trying to use the 'roles' package available on Atmosphere but I can't get it to work with Accounts.onCreateUser(), I can get the example on github. When I register a user, I want to add a role to them, when I test whether the role is assigned, it's not picking it up. Here's my code /server/users.js Accounts.onCreateUser(function(options, user){ var role = ['admin']; Roles.addUsersToRoles(user, role); return user; }); /client/page.js Template.hello.events({ 'click input': function () { var

Simple custom roles for windows authentication in asp. net?

与世无争的帅哥 提交于 2019-12-20 09:02:28
问题 At our company network, the roles in Active Directory(AD) are not appropriately assigned for my application. So I created a simple table in my database mapping all the users in the AD and their roles. There is literally only two columns in this table, user and role. I hope to take advantage of the powerful role management in asp.net, I want to use features like [Authorize(Roles = "Managers")] . is there a simple way to use these custom roles without setting up complicated role and membership

ASP.NET, how to manage users with different types of roles

你说的曾经没有我的故事 提交于 2019-12-20 06:33:27
问题 I want to create a website with various users. The users can have different roles, admin and user, which is a very well documented situation. But I would like to also group the users on their location, so at each location I can have both admins and users. - A multi dimensional role system? The reason is, that users in Germany should have access to a certain set of documents, while the Italian users shouldn't. Where should I look for documentation on this specific topic? I need some way to

Spring Security Role Hierarchy issues

醉酒当歌 提交于 2019-12-19 04:42:20
问题 I am trying to enable role hierarchy voting in Spring Security when authenticating using Waffle NTML but having some unknown issues in that the inherited roles do not appear as authorities on the principal as expected preventing hasRole expressions in both the intercept urls and using the authorize jsp taglibs. I have been integrating waffle based on the following guide: https://github.com/dblock/waffle/blob/master/Docs/spring/SpringSecuritySingleSignOnFilter.md This works within the

customer-configurable asp.net web site security for fine-grained control of page and button access

自作多情 提交于 2019-12-19 03:59:03
问题 I have an ASP.NET 2.0 [no ajax...yet] web site that will be deployed in compiled form on multiple customer sites. Typically the site will be intranet only. Some customers trust all of their people and don't care about limiting access to the site and/or page functions, others trust no one and want only certain people and/or groups to be able to view certain pages, click certain buttons, et al. i could do some home-grown solution, possibly drive the access permissions from a database table, but