Post a Job  |   Ask a Question?   |   Already registered? login or register
sadasivaiah goli
18/04/2016 11:21 AM

How to elements the Child elements in hierarchy map in spring security


I have hiearchy ROLE_SUPER_ADMIN > ROLE_PLACEMENT ROLE_SUPER_ADMIN > ROLE_ELEARNING ROLE_SUPER_ADMIN > ROLE_EXAMINATION ROLE_SUPER_ADMIN > ROLE_ORG_ADMIN ROLE_ORG_ADMIN > ROLE_HR In the above hierachy under SUPER_ADMIN role ROLE_PLACEMENT, ROLE_ELEARNING,ROLE_EXAMINATION, ROLE_ORG_ADMIN has child roles. How can we access child elements in the hiearchy
Spam    3 Comments

Pavan,Koppolu
18/04/2016 11:30:31

AnilKumar,Nayak
18/04/2016 19:17:33
you can declare like below <bean id="roleVoter" class="org.springframework.security.access.vote.RoleHierarchyVoter"> <constructor-arg ref="roleHierarchy" /> </bean> <bean id="roleHierarchy" class="org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl"> <property name="hierarchy"> <value> ROLE_SUPER_ADMIN > ROLE_PLACEMENT ROLE_SUPER_ADMIN > ROLE_ELEARNING ROLE_SUPER_ADMIN > ROLE_EXAMINATION ROLE_SUPER_ADMIN > ROLE_ORG_ADMIN ROLE_ORG_ADMIN > ROLE_HR </value> </property> </bean>

sadasivaiah,goli
19/04/2016 12:04:45
I can get the all roleHiearchy . My Question is how to construct roles as parent ,child from this.

Languages :
xml