security-roles

AuthorizeAttribute with Roles but not hard-coding the Role values

风流意气都作罢 提交于 2019-11-30 10:15:26
Is it possible to add the Roles but not hard-coding the values like: [Authorize(Roles="members, admin")] I would like to retrieve these roles from a database or configuration file where I wouldn't need to rebuild the application if I needed to add/remove Roles for a Controller Action. I know with the enums it can be done... http://www.vivienchevallier.com/Articles/create-a-custom-authorizeattribute-that-accepts-parameters-of-type-enum but even this is still not flexible enough for my needs; it's still somewhat of a hard-code, even though it is cleaner. You can create your custom authorization

Using C# to get a list of ACLs for Servers and mapped drives

♀尐吖头ヾ 提交于 2019-11-30 03:39:41
The production change implementers for our IT group have been tasked with reviewing the security for all of the various objects in our group, primarily to make sure that people who have left our employ or have transferred to other groups no longer have access to our server shares, web directories, sql databases, etc etc. We recently completed the SQL portion and we have a re-usable script that can be run annually (or at whatever frequency we come up with). It worked great and we audited 20 databases across 10 or so servers withing a few minutes. Now, for the server stuff. I have an application

Why do I list security roles in web.xml when they're in jdbcRealm database?

南楼画角 提交于 2019-11-29 19:47:59
问题 I run JavaEE 6 web application on Glassfish 3. I use JAAS with jdbcRealm and default principal to role mapping. In my database I have table for mapping usernames to their roles: username | role ----------+------- john | admin mary | user Why do I need to list these roles once again in my web.xml ? <security-role> <role-name>admin</role-name> </security-role> <security-role> <role-name>user</role-name> </security-role> Without that isUserInRole() always returns false . 回答1: You don't redefine

Spring Security Role Prefix and Custom User Details Service

让人想犯罪 __ 提交于 2019-11-29 15:29:01
How do I set the role prefix to "" with a custom user details service in Spring? <beans:bean id="authService" class="com.cisco.badges.business.services.AuthenticationService"/> <authentication-manager> <authentication-provider user-service-ref="authService"> <password-encoder ref="passwordEncoder"> <salt-source ref="saltSource" /> </password-encoder> </authentication-provider> </authentication-manager> @Service("authService") public class AuthenticationService extends BaseService implements UserDetailsService, IAuthenticationService { @Autowired IUserRepository userRepository; @Autowired

Using C# to get a list of ACLs for Servers and mapped drives

烈酒焚心 提交于 2019-11-29 00:39:50
问题 The production change implementers for our IT group have been tasked with reviewing the security for all of the various objects in our group, primarily to make sure that people who have left our employ or have transferred to other groups no longer have access to our server shares, web directories, sql databases, etc etc. We recently completed the SQL portion and we have a re-usable script that can be run annually (or at whatever frequency we come up with). It worked great and we audited 20

CakePHP ACL Database Setup: ARO / ACO structure?

和自甴很熟 提交于 2019-11-28 15:21:31
I'm struggling to implement ACL in CakePHP. After reading the documentation in the cake manual as well as several other tutorials, blog posts etc, I found Aran Johnson's excellent tutorial which has helped fill in many of the gaps. His examples seem to conflict with others I've seen though in a few places - specifically in the ARO tree structure he uses. In his examples his user groups are set up as a cascading tree, with the most general user type being at the top of the tree, and its children branching off for each more restricted access type. Elsewhere I've usually seen each user type as a

Spring Security Role Prefix and Custom User Details Service

一笑奈何 提交于 2019-11-28 08:56:50
问题 How do I set the role prefix to "" with a custom user details service in Spring? <beans:bean id="authService" class="com.cisco.badges.business.services.AuthenticationService"/> <authentication-manager> <authentication-provider user-service-ref="authService"> <password-encoder ref="passwordEncoder"> <salt-source ref="saltSource" /> </password-encoder> </authentication-provider> </authentication-manager> @Service("authService") public class AuthenticationService extends BaseService implements

CakePHP ACL Database Setup: ARO / ACO structure?

别等时光非礼了梦想. 提交于 2019-11-27 09:09:52
问题 I'm struggling to implement ACL in CakePHP. After reading the documentation in the cake manual as well as several other tutorials, blog posts etc, I found Aran Johnson's excellent tutorial which has helped fill in many of the gaps. His examples seem to conflict with others I've seen though in a few places - specifically in the ARO tree structure he uses. In his examples his user groups are set up as a cascading tree, with the most general user type being at the top of the tree, and its

How to dynamically decide <intercept-url> access attribute value in Spring Security?

£可爱£侵袭症+ 提交于 2019-11-26 15:47:19
In Spring Security we use the intercept-url tag to define the access for URLs as below: <intercept-url pattern="/**" access="ROLE_ADMIN" /> <intercept-url pattern="/student" access="ROLE_STUDENT" /> This is hard coded in applicationContext-security.xml . I want to read the access values from a database table instead. I have defined my own UserDetailsService and I read the roles for the logged in user from the database. How do I assign these roles to the URL patterns during runtime? The FilterInvocationSecurityMetadataSourceParser class in Spring-security (try Ctrl/Cmd+Shift+T in STS with the