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

daycry / auth / 22527658769

28 Feb 2026 07:41PM UTC coverage: 63.267% (-3.6%) from 66.864%
22527658769

push

github

web-flow
Merge pull request #36 from daycry/development

Implement TOTP 2FA, JWT auth, device session tracking, and docs overhaul

465 of 1168 new or added lines in 52 files covered. (39.81%)

129 existing lines in 46 files now uncovered.

3064 of 4843 relevant lines covered (63.27%)

41.53 hits per line

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

50.0
/src/Exceptions/AuthorizationException.php
1
<?php
2

3
declare(strict_types=1);
4

5
/**
6
 * This file is part of Daycry Auth.
7
 *
8
 * (c) Daycry <daycry9@proton.me>
9
 *
10
 * For the full copyright and license information, please view
11
 * the LICENSE file that was distributed with this source code.
12
 */
13

14
namespace Daycry\Auth\Exceptions;
15

16
use CodeIgniter\Exceptions\RuntimeException;
17

18
class AuthorizationException extends RuntimeException
19
{
20
    /**
21
     * Whether the request was authorised.  Stored as an instance property
22
     * to avoid the race condition that a static property would introduce in
23
     * concurrent requests.
24
     */
25
    public bool $authorized = true;
26

27
    /**
28
     * HTTP 403 Forbidden — authenticated but not permitted.
29
     */
30
    protected $code = 403;
31

32
    public static function forUnknownGroup(string $group): self
3✔
33
    {
34
        return new self(lang('Auth.unknownGroup', [$group]));
3✔
35
    }
36

37
    public static function forUnknownPermission(string $permission): self
3✔
38
    {
39
        return new self(lang('Auth.unknownPermission', [$permission]));
3✔
40
    }
41

UNCOV
42
    public static function forUnauthorized(): self
×
43
    {
NEW
44
        $e             = new self(lang('Auth.notEnoughPrivilege'));
×
NEW
45
        $e->authorized = false;
×
46

NEW
47
        return $e;
×
48
    }
49
}
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