roles

Spring Security taglib sec:authorize with role hierarchy not working

China☆狼群 提交于 2020-01-04 14:14:53
问题 I can't get sec:authorize hasRole() to work with the role hierarchy. If I have a user with role ROLE_BOSS which is the parent of ROLE_WORKER, then is false for some reason. In my service classes @PreAuthorize("hasRole('ROLE_WORKER')") does work however. I assumed they both used the same evaluator, so why doesn't the taglib work? Thanks for the help. JSP: <sec:authorize access="hasRole('ROLE_BOSS')"> <p>This shows up.</p> </sec:authorize> <sec:authorize access="hasRole('ROLE_WORKER')"> <p>This

How to create a Plone 4 group who's sole purpose is to manage users?

怎甘沉沦 提交于 2020-01-04 09:10:08
问题 I'm trying to set up a Plone group ( Plone 4.0.7 ) that will be responsible purely for creating and amending users. I don't want them to have full admin access to the site, purely to the Users and Groups functionality. I have created a role in my.package/profiles/default/rolemap.xml like so: <role name="Maintain Users" /> and then added a permission thus: <permission name="Manage users" acquire="false"> <role name="Maintain Users" /> <role name="Manager" /> </permission> In my.package

How to create a Plone 4 group who's sole purpose is to manage users?

本秂侑毒 提交于 2020-01-04 09:08:07
问题 I'm trying to set up a Plone group ( Plone 4.0.7 ) that will be responsible purely for creating and amending users. I don't want them to have full admin access to the site, purely to the Users and Groups functionality. I have created a role in my.package/profiles/default/rolemap.xml like so: <role name="Maintain Users" /> and then added a permission thus: <permission name="Manage users" acquire="false"> <role name="Maintain Users" /> <role name="Manager" /> </permission> In my.package

Ruby on rails, cancan and default role assignment

故事扮演 提交于 2020-01-03 20:13:32
问题 I have built a small ruby webservice, in this I have implemented cancan authorization. I followed this tutorial. The problem is that, I can't find out the way to assign at the user, when they do the registration to my site, the base role level. I find out to do this with a checkbox, but it's not what I want. My idea was to put this assignment directly into the registrations_controller, but I failed to save the role. I hope that somebody can help me. Thank you. 回答1: This is what worked for me

Setting roles by using GenericPrincipal instance

我怕爱的太早我们不能终老 提交于 2020-01-03 02:49:09
问题 Recently I asked a question about how to use ajax calls to authenticate user in asp.net mvc, and I got my answer. But then is decided to use 'Roles' property of 'GenericPrincipal' class so I changed my code as follow to contain 'Roles': HttpContext.User = new System.Security.Principal. GenericPrincipal(new System.Security.Principal.GenericIdentity(login.LoginName), userRole); In my site.master view, I check to see which kind of roles users belongs to and I show appropriate menu, but when I

Symfony 2 ACL and Role Hierarchy

折月煮酒 提交于 2020-01-02 06:35:28
问题 I'm a little stuck and unable to find the answer to this. In my app test I've created two Entities User and Comment both are mapped correctly. I have created a small controller which depending on the user will add the comment and the data to the ACL tables, if I create my comment as a standard user with the associated for of 'ROLE_USER', and Try to access it as user with the role 'ROLE_ADMIN' I get access denied, it seems to completely ignore the security.yml hierarchy. I know this works by

Symfony 2 ACL and Role Hierarchy

烂漫一生 提交于 2020-01-02 06:35:11
问题 I'm a little stuck and unable to find the answer to this. In my app test I've created two Entities User and Comment both are mapped correctly. I have created a small controller which depending on the user will add the comment and the data to the ACL tables, if I create my comment as a standard user with the associated for of 'ROLE_USER', and Try to access it as user with the role 'ROLE_ADMIN' I get access denied, it seems to completely ignore the security.yml hierarchy. I know this works by

Ansible - with_dict: dictionary - How to use variables defined in each dictionary which depends upon others

风格不统一 提交于 2020-01-02 04:05:36
问题 Environment is: Ansible 1.9.2, CentOS 6.5 I have created a role to download JAVA (.tar.gz) artifact files for 3 different JAVA versions from Artifactory. I'm trying to use Ansible's with_dict feature (instead of using with_items). Created the following files: $ cat roles/java/defaults/main.yml --- java_versions: java7_60: version: 1.7.60 group_path: com/oracle/jdk classifier: linux-x64 ext: tar.gz dist_file: "jdk-{{ version }}-{{ classifier }}-{{ ext }}" # dist_file: "jdk-{{item.value.version

ASP.NET MVC Roles Authorization

空扰寡人 提交于 2020-01-02 00:14:54
问题 I want to make the roles default for my controller class to "Administrators, Content Editors" [Authorize(Roles = "Administrators, Content Editor")] I've done this by adorning the controller with the attribute above. However, there is one action that I want to be available to all (namely "View"). How can I reset the Roles so that everyone (including completely unauthorized users) have access for this action. Note: I know I could adorn every single action other action with the authorize

How do you rename a Role using Membership in .NET?

女生的网名这么多〃 提交于 2020-01-01 09:45:09
问题 I'm using ASP.NET Membership and noticed there isn't a method in the Roles class to modify a role (its name for instance), only to create and delete them. Is it possible or it's not supported? EDIT: @CheGueVerra: Yes, nice workaround. Do you know (for extra credit :) ) why it's not possible? 回答1: There is no direct way to change a role name in the Membership provider. I would get the list of users that are in the role you want to rename, then remove them from the list, delete the role, create