Oftentimes, permissions are given to the “anonymous” user.
In order to check which permissions are granted to the anonymous user, we can use the Get Permission Targets Per User REST API like below:
curl -uYOURUSERNAME:PASSWORD'http://[ARTIFACTORY_URL]/artifactory/api/v2/security/permissions/users/anonymous'
It will output related permission targets like below:
[ { "name" : "dayk-test-permission1", "repo" : { "actions" : [ "read", "annotate", "managedXrayMeta", "write", "delete", "manage" ], "repositories" : [ "dayk-docker1", "dayk-docker2" ], "include-patterns" : [ "**" ], "exclude-patterns" : [ ] } }, { "name" : "read-permission", "repo" : { "actions" : [ "read" ], "repositories" : [ "dayk-generic1" ], "include-patterns" : [ "**" ], "exclude-patterns" : [ ] } }, { "name" : "test-permission", "repo" : { "actions" : ["read", "annotate", "write", "delete" ], "repositories" : [ "dayk-generic2" ], "include-patterns" : [ "**pattern-test**/**" ], "exclude-patterns" : [ ] } } ]
Similarly, if we would like to check any specific user’s permission, we can change the username from “anonymous” to a specific Username using the same REST API like below:
curl -uYOURUSERNAME:PASSWORD 'http://[ARTIFACTORY_URL]/artifactory/api/v2/security/permissions/users/USERNAME'