Jump to content
We've recently updated our Privacy Statement, available here ×

Implementing our own Voter


nirum

Recommended Posts

Hi,

 I would like to implement a custom Voter that will implement the authorization functionality that is needed by our application. We have a complex combination of  attributes and functions that will decide if a user is ALLOWED to or NOT ALLOWEd to see a report or execute certain parts of the report.

  However, I already see a custom accessdecisonmanager and voters that is implemented in your acegi security file. If I were to add another Voter to this list would it work?

<bean id="hibernateRepoServiceSecurity"
        class="org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor">
        <property name="authenticationManager"><ref local="authenticationManager"/></property>
        <property name="accessDecisionManager"><ref local="aclAccessDecisionManager"/></property>
        <property name="afterInvocationManager"><ref local="afterInvocationManager"/></property>
        <property name="objectDefinitionSource"><ref local="repositoryServiceMethodSecurity"/></property>
    </bean>

  <bean id="aclAccessDecisionManager" class="org.acegisecurity.vote.AffirmativeBased">
        <property name="allowIfAllAbstainDecisions"><value>true</value></property>
        <property name="decisionVoters">
            <list>
                <ref local="roleVoter"/>
                <ref local="aclUserAdminVoter"/>
                <ref local="aclUserUpdateVoter"/>
                <!-- <ref local="aclUserCreateVoter"/> -->
                <ref local="aclUserDeleteVoter"/>
                <ref local="aclUserReadVoter"/>
                <ref local="aclUserMoveVoter"/>
                <ref local="aclUserCopyVoter"/>
            </list>
        </property>
    </bean>

 

Thanks for your help!!

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...