1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-07-19 06:36:14 +08:00
koogua 1d2f1dd266 1.更改模块继承基类
2.升级layui到2.6.8
3.升级腾讯云播放器
4.点播增加外链支持
2021-06-12 12:34:40 +08:00

27 lines
540 B
PHP

<?php
namespace App\Validators;
use App\Exceptions\Forbidden as ForbiddenException;
use App\Exceptions\Unauthorized as UnauthorizedException;
use Phalcon\Di\Injectable;
class Validator extends Injectable
{
public function checkAuthUser($userId)
{
if (empty($userId)) {
throw new UnauthorizedException('sys.unauthorized');
}
}
public function checkOwner($userId, $ownerId)
{
if ($userId != $ownerId) {
throw new ForbiddenException('sys.forbidden');
}
}
}