We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b31415b commit 66b3ab1Copy full SHA for 66b3ab1
classes/ColdTrick/Questions/Permissions.php
@@ -71,6 +71,14 @@ public static function objectPermissionsCheck(\Elgg\Event $event): ?bool {
71
72
/* @var $returnvalue bool */
73
$returnvalue = $event->getValue();
74
+ if ($entity instanceof \ElggAnswer) {
75
+ $container = $entity->getContainerEntity()?->getContainerEntity();
76
+
77
+ // use default access for group editors to moderate answers otherwise only allow for owners
78
+ if (!$container instanceof \ElggGroup || !$container->canEdit($user->guid)) {
79
+ $returnvalue = $entity->owner_guid === $user->guid;
80
+ }
81
82
83
// expert only changes
84
if (questions_experts_enabled()) {
0 commit comments