We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Create two accounts, user1 and user2.
user1
user2
Create an organization as user1, and add user2 as a maintainer.
Create a project in the organization as user1.
Create a task in the project as user1.
Create the following script:
import os import sys from cvat_sdk import make_client def main(): proj_id = int(sys.argv[1]) with make_client( host="http://localhost:8080", credentials=(os.environ["CVAT_AI_USER"], os.environ["CVAT_AI_PASS"]) ) as client: project = client.projects.retrieve(proj_id) for task in project.get_tasks(): print(task.id) main()
Run the script with user2's credentials, passing the ID of the project. It prints nothing.
The script should print the ID of the task.
By comparison, if you run the script with user1's credentials, this does happen.
We should probably make the SDK override the current organization while making the "list tasks" request, if the project is in an organization.
Alternatively, we could alter the server's response to list all tasks that the user has access to, regardless of what organization they are in.
I believe this affects all SDK methods that list child objects of some other objects, although I haven't tested them all. These methods are:
Issue.get_comments Job.get_labels Job.get_issues Project.get_tasks Project.get_labels Task.get_jobs Task.get_labels
Reproducible with commit b594b1c.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Actions before raising this issue
Steps to Reproduce
Create two accounts,
user1
anduser2
.Create an organization as
user1
, and adduser2
as a maintainer.Create a project in the organization as
user1
.Create a task in the project as
user1
.Create the following script:
Run the script with
user2
's credentials, passing the ID of the project. It prints nothing.Expected Behavior
The script should print the ID of the task.
By comparison, if you run the script with
user1
's credentials, this does happen.Possible Solution
We should probably make the SDK override the current organization while making the "list tasks" request, if the project is in an organization.
Alternatively, we could alter the server's response to list all tasks that the user has access to, regardless of what organization they are in.
Context
I believe this affects all SDK methods that list child objects of some other objects, although I haven't tested them all. These methods are:
Environment
Reproducible with commit b594b1c.
The text was updated successfully, but these errors were encountered: