Add new dynamic view for creating API keys
This commit is contained in:
parent
87c09a921b
commit
722fd614a1
10 changed files with 311 additions and 492 deletions
|
@ -42,6 +42,11 @@ class APIKeyPolicy
|
|||
*/
|
||||
protected function checkPermission(User $user, Key $key, $permission)
|
||||
{
|
||||
// Non-administrative users cannot use administrative routes.
|
||||
if (! starts_with('user.') && ! $user->isRootAdmin()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We don't tag this cache key with the user uuid because the key is already unique,
|
||||
// and multiple users are not defiend for a single key.
|
||||
$permissions = Cache::remember('APIKeyPolicy.' . $key->public, Carbon::now()->addSeconds(5), function () use ($key) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue