package com.yuchen.saas.manage.scope.api.config;


import com.yuchen.saas.manage.scope.api.handler.ApiScopePermissionHandler;
import com.yuchen.saas.manage.scope.api.handler.DataScopeModelHandler;
import lombok.AllArgsConstructor;
import org.nest.springwrap.core.datascope.handler.ScopeModelHandler;
import org.nest.springwrap.core.secure.config.RegistryConfiguration;
import org.nest.springwrap.core.secure.handler.IPermissionHandler;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
@AllArgsConstructor
@AutoConfigureBefore(RegistryConfiguration.class)
public class ScopeConfiguration {

	@Bean
	public ScopeModelHandler scopeModelHandler() {
		return new DataScopeModelHandler();
	}

	@Bean
	public IPermissionHandler permissionHandler() {
		return new ApiScopePermissionHandler();
	}

}
