snipe-it/app/Policies/LicensePolicy.php
2017-12-06 14:49:52 -08:00

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');
}
}