AuthenticationInterface.php 1.2 KB
Newer Older
秦俊坤's avatar
秦俊坤 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<?php
/**
 * Created by PhpStorm.
 * User: qjk
 * Date: 2022/03/28
 * Time: 15:07
 */

namespace Meibuyu\Rpc\Service\Interfaces\User;

interface AuthenticationInterface
{

    /**
     * 获取对应用户能够看到的菜单
秦俊坤's avatar
秦俊坤 committed
16 17
     * @param string $applicationName
     * @param integer $userId
秦俊坤's avatar
秦俊坤 committed
18 19
     * @return array
     */
秦俊坤's avatar
秦俊坤 committed
20
    public function getMenus($applicationName, $userId): array;
秦俊坤's avatar
秦俊坤 committed
21 22 23 24


    /**
     * 获取对应用户的菜单权限
秦俊坤's avatar
秦俊坤 committed
25 26
     * @param string $applicationName 应用名称
     * @param integer $userId 用户 ID
秦俊坤's avatar
秦俊坤 committed
27 28
     * @return array
     */
秦俊坤's avatar
秦俊坤 committed
29
    public function getButtons($applicationName, $userId, $frontendPath):array;
秦俊坤's avatar
秦俊坤 committed
30 31 32 33


    /**
     * 获取对应路由的接口权限结果
秦俊坤's avatar
秦俊坤 committed
34
     * @param $path string 请求 URL 路径
秦俊坤's avatar
秦俊坤 committed
35
     * @param $method string 路由名字
秦俊坤's avatar
秦俊坤 committed
36 37 38 39
     * @param $applicationName string 应用名字
     * @param $userId integer  用户 ID
     * @return bool
     */
秦俊坤's avatar
秦俊坤 committed
40
    public function authByRouter($applicationName, $path, $method, $userId):  bool;
41 42 43 44 45 46 47 48

    /**
     * @param string $appName 应用名称
     * @param integer $userId 用户 ID
     * @param array $buttonCodes
     * @return array
     */
    public function getAppBtnAccess($appName, $userId, $buttonCodes = []): array;
秦俊坤's avatar
秦俊坤 committed
49
}