Admin Panel
Admin Panel Access Management
Introduction
In this platform, access to the admin panel is managed by the gate function, which checks if a user is authorized to view and use the admin panel. The following conditions grant users access to the admin panel:
- If the user has a role named "Admin".
- If the user's email address ends with "@cierra.de".
- If the user's email address matches specific email addresses (e.g., 'info@simon-pirmann.de', 'sp@bkf-online-schulungen.de').
Granting Admin Panel Access
To grant a user access to the admin panel, you can follow these steps:
- Assign the "Admin" role: Ensure that the user has a role with the name "Admin". This can be done in the "Roles" section of the admin panel. Assigning the "Admin" role will grant the user full access to the admin panel features.
- Use an approved email domain: If the user's email address ends with "@cierra.de", they will automatically have access to the admin panel. You can create a new user account with an email address from this domain, or update an existing user's email address to grant access.
- Add the user's email address to the list: If you want to grant access to specific users without giving them the "Admin" role, you can add their email addresses to the list within the gate function. This can be done by modifying the source code, as shown below:
Gate::define('viewNova', function ($user) {
return $user->isAdmin() || Str::endsWith($user->email, ['@cierra.de']) || in_array($user->email, [
'info@simon-pirmann.de',
'sp@bkf-online-schulungen.de',
'newuser@example.com', // Add the new user's email address here
]);
});
Remember to replace 'newuser@example.com' with the actual email address of the user you want to grant access to.
After updating the user's role, email domain, or adding their email to the list, they should be able to access the admin panel upon their next login.