Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting canViewPath parameter for collabs always returns false #1177

Closed
ghost opened this issue Jun 20, 2023 · 2 comments · Fixed by #1178
Closed

Getting canViewPath parameter for collabs always returns false #1177

ghost opened this issue Jun 20, 2023 · 2 comments · Fixed by #1178
Assignees
Labels
bug Added to issues that describes SDK bug

Comments

@ghost
Copy link

ghost commented Jun 20, 2023

We have also tested here using "Box Java SDK" SDK version: 4.1.1 (latest).
As a result, after updating, I was able to confirm that can_view_path was ON and working.
However, when I retrieve the relevant collaboration information from the code and check the can_view_path setting value, it is "false".

Source code assembled from ■Doc

// Specify Box folder
BoxFolder folder = new BoxFolder(api, "211249917343");

// Update the collaborator for the specified folder.
BoxCollaboration collaboration = new BoxCollaboration(api, "45102650930");
BoxCollaboration.Info info = collaboration.new Info();
info.setStatus(BoxCollaboration.Status.ACCEPTED);

info.setRole(Role.EDITOR); info.

info.setCanViewPath(true); ← CanViewPath is set to "true", so the target collaborator is assumed to be updated.

collaboration.updateInfo(info);

// Check the CanViewPath of the folder.
for(Info info : folder.getCollaborations()) {
boolean canViewPath = info.getCanViewPath();
System.out.println(canViewPath); ← Assumed to change to "true" with the above update, but it remains "false".
}

The can_view_path setting being false was reported as a "bug" in the past and was fixed, but it is possible that the bug has reappeared in some version.
#569

@ghost ghost added the bug Added to issues that describes SDK bug label Jun 20, 2023
@antusus
Copy link
Contributor

antusus commented Jun 20, 2023

Hello @Tsuji238 ,

If you look here:
https://developer.box.com/reference/get-folders-id-collaborations/
the can_view_path is not returned by default. In Java SDK I can see we are returning bool not Boolean and that is possibly why you are seeing false value there.

Can you verify it with CURL call first let's do that as Java SDK does:

curl -i -X GET "https://api.box.com/2.0/folders/<your_folder_id>/collaborations" \
     -H "Authorization: Bearer <ACCESS_TOKEN>"

and next with asking for this field directly:

curl -i -X GET "https://api.box.com/2.0/folders/<your_folder_id>/collaborations?fields=id%2Ctype%2Cname%2Ccan_view_path" \
     -H "Authorization: Bearer <ACCESS_TOKEN>"

and check if you are getting true value in can_view_path?

@antusus
Copy link
Contributor

antusus commented Jun 21, 2023

Fix will be available in the 4.2.0 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Added to issues that describes SDK bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants