We need to separate permissions in our repositories on a per team basis. Therefore, I am trying to create content selectors to allow our teams to maintain their own docker images.
Pushing works like a charm, problems arise when trying to setup selective permissions for deleting images from the registry.
I have setup a content selector so teams can browse the registry:
format == "docker" and (
path == "/" or
path == "/v2/"
)
And several that are to be used for allowing them to delete their images (which is also the selector used for pushing):
format == "docker" and path =^ "/v2/team1/"
Then, I created 2 privileges:
- ‘browse_repo’ using first selector and action ‘Browse’
- ‘team1_maintenance’ using second selector and action ‘Delete’
The problem I now have, is that ‘team1’ is only able to browse the tree to ‘/v2/team1/’, but they are able to delete the whole registry by selecting ‘v2’ in the tree and clicking ‘Delete folder’.
When I remove the second privilege, the team can only see ‘/v2/’, but are correctly not able to delete anything.
Removing the first privilege, makes it so they can’t browse at all!
Am I doing something wrong here? How can I configure it correctly to let my teams see all their images in the registry, but not allow them to delete the images that are not theirs?