mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
29 lines
576 B
PHP
29 lines
576 B
PHP
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\License;
|
|
use App\Models\User;
|
|
use App\Policies\CheckoutablePermissionsPolicy;
|
|
|
|
class LicensePolicy extends CheckoutablePermissionsPolicy
|
|
{
|
|
protected function columnName()
|
|
{
|
|
return 'licenses';
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can view license keys
|
|
*
|
|
* @param \App\Models\User $user
|
|
* @param \App\Models\License $license
|
|
* @return mixed
|
|
*/
|
|
public function viewKeys(User $user, License $license = null)
|
|
{
|
|
return $user->hasAccess('licenses.keys');
|
|
}
|
|
|
|
}
|