Added comments to SnipePermissionsPolicy for clarity

This commit is contained in:
snipe 2017-12-07 21:00:09 -08:00
parent defed52caa
commit a65ea639ed

View file

@ -5,9 +5,31 @@ use App\Models\Company;
use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;
/**
* SnipePermissionsPolicy provides methods for handling the granular permissions used throughout Snipe-IT.
* Each "area" of a permission (which is usually a model, like Assets, Departments, etc), has a setting
* in config/permissions.php like view/create/edit/delete (and sometimes some extra stuff like
* checkout/checkin, etc.)
*
* A Policy should exist for each of these models, however if they only use the standard view/create/edit/delete,
* the policy can be pretty simple, for example with just one method setting the column name:
*
* protected function columnName()
* {
* return 'manufacturers';
* }
*
*/
abstract class SnipePermissionsPolicy
{
// This should return the key of the model in the users json permission string.
/**
* This should return the key of the model in the users json permission string.
*
* @return boolean
*/
//
abstract protected function columnName();
use HandlesAuthorization;