Files
id/src/Id/Enums/Role.php
T
envoyr 642e518259 Give trusted apps the user's role
Anikeen ID now sends trusted apps the user's role (admin or user) in
GET v1/user, a user read by ID and user.updated, so an app like the
Console can take its admins from Anikeen ID. Enums\Role, the Socialite
user's role and Resources\User::role()/isAdmin() expose it.
2026-11-07 15:24:48 +00:00

23 lines
472 B
PHP

<?php
namespace Anikeen\Id\Enums;
/**
* A user's role on Anikeen ID. Only trusted apps see it: `role` of GET v1/user (the Socialite
* user), of a user read by ID and of user.updated; other apps get none.
*/
class Role
{
/** Runs Anikeen (the Anikeen ID admin panel). */
const ADMIN = 'admin';
const USER = 'user';
/**
* @return list<string>
*/
public static function all(): array
{
return [self::ADMIN, self::USER];
}
}