| @@ 454-469 (lines=16) @@ | ||
| 451 | return array_fill_keys($deletable, true) + array_fill_keys($ids, false); |
|
| 452 | } |
|
| 453 | ||
| 454 | public function canDelete($id, Member $member = null) |
|
| 455 | { |
|
| 456 | // No ID: Check default permission |
|
| 457 | if (!$id) { |
|
| 458 | return $this->checkDefaultPermissions(self::DELETE, $member); |
|
| 459 | } |
|
| 460 | ||
| 461 | // Regular canEdit logic is handled by canEditMultiple |
|
| 462 | $results = $this->canDeleteMultiple( |
|
| 463 | [ $id ], |
|
| 464 | $member |
|
| 465 | ); |
|
| 466 | ||
| 467 | // Check if in result |
|
| 468 | return isset($results[$id]) ? $results[$id] : false; |
|
| 469 | } |
|
| 470 | ||
| 471 | public function canEdit($id, Member $member = null) |
|
| 472 | { |
|
| @@ 471-486 (lines=16) @@ | ||
| 468 | return isset($results[$id]) ? $results[$id] : false; |
|
| 469 | } |
|
| 470 | ||
| 471 | public function canEdit($id, Member $member = null) |
|
| 472 | { |
|
| 473 | // No ID: Check default permission |
|
| 474 | if (!$id) { |
|
| 475 | return $this->checkDefaultPermissions(self::EDIT, $member); |
|
| 476 | } |
|
| 477 | ||
| 478 | // Regular canEdit logic is handled by canEditMultiple |
|
| 479 | $results = $this->canEditMultiple( |
|
| 480 | [ $id ], |
|
| 481 | $member |
|
| 482 | ); |
|
| 483 | ||
| 484 | // Check if in result |
|
| 485 | return isset($results[$id]) ? $results[$id] : false; |
|
| 486 | } |
|
| 487 | ||
| 488 | public function canView($id, Member $member = null) |
|
| 489 | { |
|
| @@ 488-503 (lines=16) @@ | ||
| 485 | return isset($results[$id]) ? $results[$id] : false; |
|
| 486 | } |
|
| 487 | ||
| 488 | public function canView($id, Member $member = null) |
|
| 489 | { |
|
| 490 | // No ID: Check default permission |
|
| 491 | if (!$id) { |
|
| 492 | return $this->checkDefaultPermissions(self::VIEW, $member); |
|
| 493 | } |
|
| 494 | ||
| 495 | // Regular canView logic is handled by canViewMultiple |
|
| 496 | $results = $this->canViewMultiple( |
|
| 497 | [ $id ], |
|
| 498 | $member |
|
| 499 | ); |
|
| 500 | ||
| 501 | // Check if in result |
|
| 502 | return isset($results[$id]) ? $results[$id] : false; |
|
| 503 | } |
|
| 504 | ||
| 505 | /** |
|
| 506 | * Get field to check for permission type for the given check. |
|