Fixed Can't reassign resource if it not approved

Kruzya

Well-known member
Affected version
2.2.3
If resource is not approved by moderators, it can't be reassigned to another user, because "the new owner must be able to view this resource":
1630832916314.png

All resource categories is visible for all users include guests.
 
I think this and the error message provided is reasonable and ultimately as designed.

If the resource is awaiting approval and the new resource author is unable to view unapproved resources then the error makes sense.

You will have to approve first and then reassign after.
 
We have cases when one user posts a resource who developed by another user. We want give ability edit resource for real author before they will be approved. Suggested workflow is a ****.

Anyway, right now i found ability reassign resource to another user without approving: just reassign resource to self, add target user in "resource team" and reassign to he. In this case, it works.
 
Censored or not, I think you're perfectly capable of getting your point across without using bad language at us.

Glad you found a workaround that works.
 
A new, more beautiful, workaround: just use inline moderation. In inline mod, there are no one checks about user resource visibility.

Why this feature works too different from different interfaces? Can you explain? This is really "as designed"? If yes, when we can wait fix ability reassign resource without view permissions to another user in inline mod? :)
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XFRM release (2.2.4).

Change log:
Allow reassigning a resource to users who may not have permission to view it
There may be a delay before changes are rolled out to the XenForo Community.
 
When XFRM 2.2.4 will be released? I guessed it will be happened with XF 2.2.7, but i don't see any information about release now.
 
Not in this cycle, unfortunately. There were not enough changes or significant bug fixes to warrant a release right now.

If you want to apply the fix you can by modifying the files:

Diff:
diff --git a/src/addons/XFRM/Pub/Controller/ResourceItem.php b/src/addons/XFRM/Pub/Controller/ResourceItem.php
index e71e394303..44d7e54881 100644
--- a/src/addons/XFRM/Pub/Controller/ResourceItem.php
+++ b/src/addons/XFRM/Pub/Controller/ResourceItem.php
@@ -1510,15 +1510,6 @@ public function actionReassign(ParameterBag $params)
                 return $this->error(\XF::phrase('requested_user_not_found'));
             }
 
-            $canTargetView = \XF::asVisitor($user, function() use ($resource)
-            {
-                return $resource->canView();
-            });
-            if (!$canTargetView)
-            {
-                return $this->error(\XF::phrase('xfrm_new_owner_must_be_able_to_view_this_resource'));
-            }
-
             /** @var \XFRM\Service\ResourceItem\Reassign $reassigner */
             $reassigner = $this->service('XFRM:ResourceItem\Reassign', $resource);
(Just delete the red lines)
 
Last edited:
Back
Top Bottom