| @@ 53-65 (lines=13) @@ | ||
| 50 | return false; |
|
| 51 | } |
|
| 52 | ||
| 53 | public function updatableBy(User $user) |
|
| 54 | { |
|
| 55 | // created by me |
|
| 56 | if ($this->event->getCreatedBy() === $user) { |
|
| 57 | return true; |
|
| 58 | } |
|
| 59 | // we're a superadmin |
|
| 60 | if ($user->isAdmin()) { |
|
| 61 | return true; |
|
| 62 | } |
|
| 63 | ||
| 64 | return false; |
|
| 65 | } |
|
| 66 | ||
| 67 | public function deteteableBy(User $user) |
|
| 68 | { |
|
| @@ 67-79 (lines=13) @@ | ||
| 64 | return false; |
|
| 65 | } |
|
| 66 | ||
| 67 | public function deteteableBy(User $user) |
|
| 68 | { |
|
| 69 | // created by me |
|
| 70 | if ($this->event->getCreatedBy() === $user) { |
|
| 71 | return true; |
|
| 72 | } |
|
| 73 | // we're a superadmin |
|
| 74 | if ($user->isAdmin()) { |
|
| 75 | return true; |
|
| 76 | } |
|
| 77 | ||
| 78 | return false; |
|
| 79 | } |
|
| 80 | } |
|
| 81 | ||
| @@ 61-73 (lines=13) @@ | ||
| 58 | return false; |
|
| 59 | } |
|
| 60 | ||
| 61 | public function updatableBy(User $user) |
|
| 62 | { |
|
| 63 | // it's me! |
|
| 64 | if ($this->user === $user) { |
|
| 65 | return true; |
|
| 66 | } |
|
| 67 | // we're a superadmin |
|
| 68 | if ($user->isAdmin()) { |
|
| 69 | return true; |
|
| 70 | } |
|
| 71 | ||
| 72 | return false; |
|
| 73 | } |
|
| 74 | ||
| 75 | public function deteteableBy(User $user) |
|
| 76 | { |
|
| @@ 75-87 (lines=13) @@ | ||
| 72 | return false; |
|
| 73 | } |
|
| 74 | ||
| 75 | public function deteteableBy(User $user) |
|
| 76 | { |
|
| 77 | // it's me! |
|
| 78 | if ($this->user === $user) { |
|
| 79 | return true; |
|
| 80 | } |
|
| 81 | // we're a superadmin |
|
| 82 | if ($user->isAdmin()) { |
|
| 83 | return true; |
|
| 84 | } |
|
| 85 | ||
| 86 | return false; |
|
| 87 | } |
|
| 88 | } |
|
| 89 | ||