芝麻web文件管理V1.00
编辑当前文件:/home/digitalh/yeahea.digitalhubbd.com/app/Policies/AttributePolicy.php
check(); } /** * Determine whether the user can view the Attribute. * * @param \App\Models\User $user * @param \App\Models\Attribute $attribute * @return mixed */ public function view(User $user, Attribute $attribute) { return (new Authorize($user, 'view_attribute', $attribute))->check(); } /** * Determine whether the user can create Attributes. * * @param \App\Models\User $user * @return mixed */ public function create(User $user) { return (new Authorize($user, 'add_attribute'))->check(); } /** * Determine whether the user can update the Attribute. * * @param \App\Models\User $user * @param \App\Models\Attribute $attribute * @return mixed */ public function update(User $user, Attribute $attribute) { if (!$user->isFromPlatform() && $attribute->shop_id != $user->merchantId()) { return false; } return (new Authorize($user, 'edit_attribute', $attribute))->check(); } /** * Determine whether the user can delete the Attribute. * * @param \App\Models\User $user * @param \App\Models\Attribute $attribute * @return mixed */ public function delete(User $user, Attribute $attribute) { if (!$user->isFromPlatform() && $attribute->shop_id != $user->merchantId()) { return false; } return (new Authorize($user, 'delete_attribute', $attribute))->check(); } /** * Determine whether the user can delete the Product. * * @param \App\Models\User $user * @param \App\Models\Attribute $attribute * @return mixed */ public function massDelete(User $user, Attribute $attribute = null) { if ($attribute && !$user->isFromPlatform() && $attribute->shop_id != $user->merchantId()) { return false; } return (new Authorize($user, 'delete_attribute'))->check(); } }