| <!-- |
| 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. See accompanying LICENSE file. |
| --> |
| |
| <beans xmlns="http://www.springframework.org/schema/beans" |
| xmlns:scr="http://www.springframework.org/schema/security" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns:context="http://www.springframework.org/schema/context" |
| xmlns:util="http://www.springframework.org/schema/util" |
| xsi:schemaLocation="http://www.springframework.org/schema/beans |
| http://www.springframework.org/schema/beans/spring-beans-4.3.xsd |
| http://www.springframework.org/schema/security |
| http://www.springframework.org/schema/security/spring-security.xsd |
| http://www.springframework.org/schema/util |
| http://www.springframework.org/schema/util/spring-util-4.3.xsd |
| http://www.springframework.org/schema/context |
| http://www.springframework.org/schema/context/spring-context.xsd"> |
| |
| <scr:global-method-security pre-post-annotations="enabled"> |
| <scr:expression-handler ref="expressionHandler"/> |
| </scr:global-method-security> |
| |
| <!-- acl config --> |
| <bean id="aclPermissionFactory" class="org.apache.kylin.rest.security.AclPermissionFactory"/> |
| |
| <bean id="expressionHandler" |
| class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler"> |
| <property name="permissionEvaluator" ref="permissionEvaluator"/> |
| </bean> |
| |
| <bean id="permissionEvaluator" |
| class="org.apache.kylin.rest.security.KylinAclPermissionEvaluator"> |
| <constructor-arg type="org.apache.kylin.rest.service.AclService"> |
| <null/> |
| </constructor-arg> |
| <constructor-arg ref="aclPermissionFactory"/> |
| </bean> |
| |
| <bean id="aclAuthorizationStrategy" |
| class="org.springframework.security.acls.domain.AclAuthorizationStrategyImpl"> |
| <constructor-arg> |
| <list> |
| <bean |
| class="org.springframework.security.core.authority.SimpleGrantedAuthority"> |
| <constructor-arg value="ROLE_ADMIN"/> |
| </bean> |
| <bean |
| class="org.springframework.security.core.authority.SimpleGrantedAuthority"> |
| <constructor-arg value="ROLE_ADMIN"/> |
| </bean> |
| <bean |
| class="org.springframework.security.core.authority.SimpleGrantedAuthority"> |
| <constructor-arg value="ROLE_ADMIN"/> |
| </bean> |
| </list> |
| </constructor-arg> |
| </bean> |
| |
| <bean id="auditLogger" |
| class="org.springframework.security.acls.domain.ConsoleAuditLogger"/> |
| |
| <bean id="permissionGrantingStrategy" |
| class="org.springframework.security.acls.domain.DefaultPermissionGrantingStrategy"> |
| <constructor-arg ref="auditLogger"/> |
| </bean> |
| |
| </beans> |