cvat-ai / cvat

Annotate better with CVAT, the industry-leading data engine for machine learning. Used and trusted by teams at any scale, for data of any scale.
https://cvat.ai
MIT License
12.64k stars 3.01k forks source link

How restrict the workers download? #8714

Open azadehashouri opened 3 days ago

azadehashouri commented 3 days ago

Actions before raising this issue

Is your feature request related to a problem? Please describe.

Hello,

I want to restrict the download option for worker users, I mean I want my worker members aren't allowed to export jobs, tasks, projects and generally data.

I edited cvat/cvat/apps/engine/rules/jobs.rego file in this way and commented the codes related to export annotation and dataset:

allow if {
    input.scope in {
        utils.VIEW,
#        utils.EXPORT_DATASET, utils.EXPORT_ANNOTATIONS,
        utils.VIEW_ANNOTATIONS, utils.VIEW_DATA, utils.VIEW_METADATA
    }
    utils.is_sandbox
    is_job_staff
}

allow if {
    input.scope in {
        utils.VIEW,
#        utils.EXPORT_DATASET, utils.EXPORT_ANNOTATIONS, 
        utils.VIEW_ANNOTATIONS, utils.VIEW_DATA, utils.VIEW_METADATA
    }
    input.auth.organization.id == input.resource.organization.id
    organizations.has_perm(organizations.WORKER)
    is_job_staff
}

after that I run these commands to rebuild cvat_server:

sudo docker compose -f docker-compose.yml -f docker-compose.dev.yml down

sudo docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build --force-recreate cvat_server

But unfortunately, it doesn't work and my worker members can still export and download data.

Please help me to solve this problem to protect my data.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

bsekachev commented 1 day ago

Try to rebuild and restart all services, not just cvat_server. As it only returns a bundle with rules, hovewer cvat_opa is responsible for authorization.

azadehashouri commented 1 hour ago

I solve this by comment utils.EXPORT_DATASET, utils.EXPORT_ANNOTATIONS in tasks.rego file and rebuild cvat_server and run all required containers again.

Thanks for your reply.

@bsekachev