spring-security-acl.xml 3.21 KB
Newer Older
Matija Obreza's avatar
Matija Obreza committed
1 2
<?xml version="1.0" encoding="UTF-8"?>
<!--
Matija Obreza's avatar
Matija Obreza committed
3 4 5 6 7 8 9 10 11 12 13 14 15
  Copyright 2014 Global Crop Diversity Trust
  
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
  
    http://www.apache.org/licenses/LICENSE-2.0
  
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
16
-->
Matija Obreza's avatar
Matija Obreza committed
17

18 19
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">
Matija Obreza's avatar
Matija Obreza committed
20

21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
	<bean name="aclAuthorizationStrategy" class="org.springframework.security.acls.domain.AclAuthorizationStrategyImpl">
		<constructor-arg index="0">
			<list value-type="org.springframework.security.core.authority.SimpleGrantedAuthority">
				<!--TODO review -->
				<value>ADMINISTRATOR</value>
			</list>
		</constructor-arg>
	</bean>

	<bean name="slf4jAuditLogger" class="org.genesys2.server.security.Slf4jAuditLogger" />

	<bean name="permissionGrantingStrategy" class="org.springframework.security.acls.domain.DefaultPermissionGrantingStrategy">
		<constructor-arg type="org.springframework.security.acls.domain.AuditLogger" ref="slf4jAuditLogger" />
	</bean>

36 37
	<bean id="aclCacheCache" factory-bean="cacheManager" factory-method="getCache">
	    <constructor-arg value="aclcache"/>
38
	</bean>
39 40 41
	
	<bean name="aclCache" class="org.genesys2.server.cache.HazelcastAclCache">
		<constructor-arg ref="aclCacheCache" />
42 43 44 45 46 47 48 49 50 51
		<constructor-arg type="org.springframework.security.acls.model.PermissionGrantingStrategy" ref="permissionGrantingStrategy" />
		<constructor-arg type="org.springframework.security.acls.domain.AclAuthorizationStrategy" ref="aclAuthorizationStrategy" />
	</bean>

	<bean name="lookupStrategy" class="org.springframework.security.acls.jdbc.BasicLookupStrategy">
		<constructor-arg type="javax.sql.DataSource" ref="dataSource" />
		<constructor-arg type="org.springframework.security.acls.model.AclCache" ref="aclCache" />
		<constructor-arg type="org.springframework.security.acls.domain.AclAuthorizationStrategy" ref="aclAuthorizationStrategy" />
		<constructor-arg type="org.springframework.security.acls.model.PermissionGrantingStrategy" ref="permissionGrantingStrategy" />
	</bean>
Matija Obreza's avatar
Matija Obreza committed
52

Matija Obreza's avatar
Matija Obreza committed
53
	<!-- FIXME Should not be using JdbcMutableAclService, but own service! -->
54 55 56 57 58 59 60 61 62
	<bean name="aclService" class="org.springframework.security.acls.jdbc.JdbcMutableAclService">
		<constructor-arg type="javax.sql.DataSource" ref="dataSource" />
		<constructor-arg type="org.springframework.security.acls.jdbc.LookupStrategy" ref="lookupStrategy" />
		<constructor-arg type="org.springframework.security.acls.model.AclCache" ref="aclCache" />
	</bean>

	<bean name="permissionEvaluator" class="org.springframework.security.acls.AclPermissionEvaluator">
		<constructor-arg index="0" type="org.springframework.security.acls.model.AclService" ref="aclService" />
	</bean>
Matija Obreza's avatar
Matija Obreza committed
63 64

</beans>