You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Label must belong to a label tree that is used by one of the projects.
&& DB::table('label_tree_project')
->whereIn('project_id', $projectIds)
->where('label_tree_id', $label->label_tree_id)
->exists();
The policy checks if a label intended for a new annotation belongs to a label tree that is attached to the project(s) of the file. If this is not the case, the user now just receives a cryptic "unauthorized" response. This should be improved with a more helpful error message. Use Response::deny() for this with the message: "You are not authorized to use label xxx because the label tree is not attached to the project."
Maybe we should look through the other policies if there are other places where we could improve error messages.
The text was updated successfully, but these errors were encountered:
core/app/Policies/AnnotationPolicy.php
Lines 124 to 128 in 5f6861a
The policy checks if a label intended for a new annotation belongs to a label tree that is attached to the project(s) of the file. If this is not the case, the user now just receives a cryptic "unauthorized" response. This should be improved with a more helpful error message. Use
Response::deny()
for this with the message: "You are not authorized to use label xxx because the label tree is not attached to the project."Maybe we should look through the other policies if there are other places where we could improve error messages.
The text was updated successfully, but these errors were encountered: