• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

php-casbin / think-authz / 15025144079

14 May 2025 03:44PM UTC coverage: 92.667%. Remained the same
15025144079

Pull #52

github

web-flow
Merge db5c61a49 into 6639f0fd9
Pull Request #52: fix: delete without condition if cache disabled

1 of 1 new or added line in 1 file covered. (100.0%)

139 of 150 relevant lines covered (92.67%)

48.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/middleware/Basic.php
1
<?php
2

3
namespace tauthz\middleware;
4

5
use tauthz\exception\Unauthorized;
6
use tauthz\facade\Enforcer;
7
use think\Request;
8

9
class Basic
10
{
11
    /**
12
     * Undocumented function.
13
     *
14
     * @param Request  $request
15
     * @param \Closure $next
16
     * @param mixed    ...$args
17
     *
18
     * @return mixed
19
     */
20
    public function handle(Request $request, \Closure $next, $args)
21
    {
22
        $authzIdentifier = $this->getAuthzIdentifier($request);
×
23
        if (!$authzIdentifier) {
×
24
            throw new Unauthorized();
×
25
        }
26

27
        if (!Enforcer::enforce($authzIdentifier, ...$args)) {
×
28
            throw new Unauthorized();
×
29
        }
30

31
        return $next($request);
×
32
    }
33

34
    public function getAuthzIdentifier(Request $request)
35
    {
36
        return $request->middleware('auth_id');
×
37
    }
38
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc