Skip to content

Commit

Permalink
LocationCategory - permissions
Browse files Browse the repository at this point in the history
closes #133
  • Loading branch information
jsirish committed Feb 10, 2017
1 parent 2694c42 commit 03b2f70
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion code/objects/LocationCategory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
class LocationCategory extends DataObject
{

/**
* @var array
*/
Expand All @@ -35,6 +34,7 @@ class LocationCategory extends DataObject
* @var string
*/
private static $singular_name = 'Category';

/**
* @var string
*/
Expand All @@ -45,4 +45,39 @@ class LocationCategory extends DataObject
*/
private static $default_sort = 'Name';

/**
* @param null|Member $member
* @return bool
*/
public function canView($member = null)
{
return true;
}

/**
* @param null|Member $member
* @return bool|int
*/
public function canEdit($member = null)
{
return Permission::check('Location_EDIT', 'any', $member);
}

/**
* @param null|Member $member
* @return bool|int
*/
public function canDelete($member = null)
{
return Permission::check('Location_DELETE', 'any', $member);
}

/**
* @param null|Member $member
* @return bool|int
*/
public function canCreate($member = null)
{
return Permission::check('Location_CREATE', 'any', $member);
}
}

0 comments on commit 03b2f70

Please sign in to comment.