All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.silentgo.shiro.ShiroInitConfig Maven / Gradle / Ivy

There is a newer version: 0.1.1
Show newest version
package com.silentgo.shiro;

import com.silentgo.core.config.Config;
import com.silentgo.core.config.SilentGoConfig;
import org.apache.shiro.realm.AuthorizingRealm;

/**
 * Project : SilentGo
 * Package : com.silentgo.shiro
 *
 * @author teddyzhu
 *         

* Created by teddyzhu on 2016/10/14. */ public class ShiroInitConfig implements Config { private AuthorizingRealm realm; public ShiroInitConfig(AuthorizingRealm realm) { this.realm = realm; } @Override public void initialBuild(SilentGoConfig config) { //enable shiro config.addExtraFactory(ShiroFactory.class); config.addExtraAction(new ShiroAction()); config.addAbstractConfig(new ShiroConfig(realm)); //initial interceptor config.addExtraAnInterceptor(RequiresAuthenticationAnnotationResolver.class); config.addExtraAnInterceptor(RequiresRolesAnnotationResolver.class); config.addExtraAnInterceptor(RequiresGuestAnnotationResolver.class); config.addExtraAnInterceptor(RequiresUserAnnotationResolver.class); config.addExtraAnInterceptor(RequiresPermissionsAnnotationResolver.class); } @Override public void afterInit(SilentGoConfig config) { } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy