Changeset 5372778 for app


Ignore:
Timestamp:
08/26/24 14:20:34 (3 months ago)
Author:
bube-ristovska <ristovska725@…>
Branches:
main
Children:
3c89e27
Parents:
8a258ab
Message:

Middleware for permissions based on officer, policeman or both

Location:
app/Http
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • app/Http/Controllers/SessionsController.php

    r8a258ab r5372778  
    5454        if ($this->verifyPassword($password, $value, $value2)) {
    5555            // Authentication passed
     56            Session::put('auth', true);
    5657            Session::put('badge_no', $badge_no);
    5758            Session::put('is_policeman', $policeman);
  • app/Http/Kernel.php

    r8a258ab r5372778  
    2222        \App\Http\Middleware\TrimStrings::class,
    2323        \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
     24    ];
     25    protected $routeMiddleware = [
     26        // other middleware
     27        'policeman' => \App\Http\Middleware\CheckPoliceman::class,
     28        'officer' => \App\Http\Middleware\CheckOfficer::class,
     29        'both' => \App\Http\Middleware\CheckBoth::class,
    2430    ];
    2531
Note: See TracChangeset for help on using the changeset viewer.