AuthenticationServiceInterface.php 949 Bytes
<?php
/**
 * Created by PhpStorm.
 * User: zero
 * Date: 2020/5/26
 * Time: 15:17
 */

namespace Meibuyu\Micro\Service\Interfaces\User;

interface AuthenticationServiceInterface
{

    /**
     * 获取对应用户能够看到的菜单
     * @param string $appName
     * @param integer $userId
     * @return array
     */
    public function getMenus($appName, $userId): array;


    /**
     * 获取对应用户的菜单权限
     * @param string $appName 应用名称
     * @param integer $userId 用户 ID
     * @return array
     */
    public function getButtons($appName, $userId, $frontendPath):array;


    /**
     * 获取对应路由的接口权限结果
     * @param $route string 路由名字
     * @param $appName string 应用名字
     * @param $method string  请求方法
     * @param $userId integer  用户 ID
     * @return bool
     */
    public function authByRouter($appName, $route, $method, $userId):  bool;

}