Closed Mcibula closed 9 months ago
Zatial takto asi. Rychly tutorial k user roles:
traveller
(bezny user) a admin
(pani sekretarka)web.php
boli upravene tak, aby rozlisovali medzi adminom a beznym pouzivatelom// Is user logged-in?
Auth::check();
// Does the currently logged-in user has role ...?
Auth::user()->hasRole('...');
// Get role name of the logged-in user
Auth::user()->getRoleNames();
// The same as above for an arbitrary user in the DB
$user->hasRole('...');
$user->getRoleNames();
$user = User::create()
je treba potom spravit $user->assignRole('...')
. Spravil som to uz v SynchronizationController
v tomto PR, ale bude to zrejme treba spravit aj v #77 .
config/permission.php
amigrations/2024_01_28_012937_create_permission_tables.php
su automaticky generovane, netreba mat strach.