master
kira 6 years ago
parent 091fb0c830
commit 1bc4c2d6d9

@ -1,7 +1,7 @@
package au.com.royalpay.payment.manage.permission.manager; package au.com.royalpay.payment.manage.permission.manager;
import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionPartnerManager;
import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionManager; import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionManager;
import au.com.royalpay.payment.manage.management.sysconfig.core.PermissionPartnerManager;
import au.com.royalpay.payment.manage.signin.core.SignInStatusManager; import au.com.royalpay.payment.manage.signin.core.SignInStatusManager;
import au.com.royalpay.payment.tools.CommonConsts; import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.exceptions.ForbiddenException; import au.com.royalpay.payment.tools.exceptions.ForbiddenException;
@ -13,6 +13,8 @@ import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.Ordered; import org.springframework.core.Ordered;
import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -30,6 +32,7 @@ import javax.servlet.http.HttpServletResponse;
*/ */
@Component @Component
public class ManagerUserInterceptor extends HandlerInterceptorAdapter implements Ordered { public class ManagerUserInterceptor extends HandlerInterceptorAdapter implements Ordered {
Logger logger = LoggerFactory.getLogger(getClass());
@Resource @Resource
private SignInStatusManager signInStatusManager; private SignInStatusManager signInStatusManager;
@Resource @Resource
@ -108,6 +111,7 @@ public class ManagerUserInterceptor extends HandlerInterceptorAdapter implements
if(func!=null && StringUtils.isNotEmpty(func.getString("module_id"))){ if(func!=null && StringUtils.isNotEmpty(func.getString("module_id"))){
JSONArray arr = loginUser.getJSONArray("available_module_ids"); JSONArray arr = loginUser.getJSONArray("available_module_ids");
if (arr == null || !arr.contains(func.getString("module_id"))) { if (arr == null || !arr.contains(func.getString("module_id"))) {
logger.info(funcId);
throw new ForbiddenException("error.permission.nopermission"); throw new ForbiddenException("error.permission.nopermission");
} }
} }

Loading…
Cancel
Save