canDo('temp.calendar__eventpriority.view') && $user->isAdmin()) { return true; } return $calendar__eventpriority->user_id == user_id() && $calendar__eventpriority->user_type == user_type(); } /** * Determine if the given user can create a calendar__eventpriority. * * @param UserPolicy $user * @param CalendarEventpriority $calendar__eventpriority * * @return bool */ public function create(UserPolicy $user) { return $user->canDo('temp.calendar__eventpriority.create'); } /** * Determine if the given user can update the given calendar__eventpriority. * * @param UserPolicy $user * @param CalendarEventpriority $calendar__eventpriority * * @return bool */ public function update(UserPolicy $user, CalendarEventpriority $calendar__eventpriority) { if ($user->canDo('temp.calendar__eventpriority.edit') && $user->isAdmin()) { return true; } return $calendar__eventpriority->user_id == user_id() && $calendar__eventpriority->user_type == user_type(); } /** * Determine if the given user can delete the given calendar__eventpriority. * * @param UserPolicy $user * @param CalendarEventpriority $calendar__eventpriority * * @return bool */ public function destroy(UserPolicy $user, CalendarEventpriority $calendar__eventpriority) { return $calendar__eventpriority->user_id == user_id() && $calendar__eventpriority->user_type == user_type(); } /** * Determine if the given user can verify the given calendar__eventpriority. * * @param UserPolicy $user * @param CalendarEventpriority $calendar__eventpriority * * @return bool */ public function verify(UserPolicy $user, CalendarEventpriority $calendar__eventpriority) { if ($user->canDo('temp.calendar__eventpriority.verify')) { return true; } return false; } /** * Determine if the given user can approve the given calendar__eventpriority. * * @param UserPolicy $user * @param CalendarEventpriority $calendar__eventpriority * * @return bool */ public function approve(UserPolicy $user, CalendarEventpriority $calendar__eventpriority) { if ($user->canDo('temp.calendar__eventpriority.approve')) { return true; } return false; } /** * Determine if the user can perform a given action ve. * * @param [type] $user [description] * @param [type] $ability [description] * * @return [type] [description] */ public function before($user, $ability) { if ($user->isSuperuser()) { return true; } } }