package org.springblade.common.constant;

import org.apache.commons.lang3.StringUtils;
import org.springblade.core.secure.BladeUser;

/**
 * @Author: Silent
 * @Description
 * @Date: Created in 14:59 2021/10/12
 * @Modified By:
 */
public interface Agent {
	//角色名称
	String roleName = "agent";

	//租户ID
	String tenantId = "000000";

	/**
	 * 判断是否是代理
	 * @param bladeUser
	 * @return
	 */
	static boolean isAgent(BladeUser bladeUser) {
		return StringUtils.equals(bladeUser.getTenantId(), tenantId) && StringUtils.equals(bladeUser.getRoleName(), roleName);
	}
}
