Skip to content

Commit

Permalink
Documentation for PermissionTarget's creation (#471)
Browse files Browse the repository at this point in the history
Fixes #434
Co-authored-by: allburov <[email protected]>
  • Loading branch information
vittoriocanilli authored Jan 24, 2025
1 parent 7eb38ec commit 9a8d824
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,18 @@ And for more modular control:
from dohq_artifactory import PermissionTarget

permission = artifactory_.find_permission_target("rule")
if permission is None:
# Permission target does not exist
permission = PermissionTarget(
artifactory_,
"rule",
repositories=Object, # <RepositiryLocal repo1>, <RepositiryLocal repo2>
users=Object, # <User user1>, <User user2>
groups=Object, # <Group group1>, <Group group2>
includes_pattern="com.mycompany.myproject1.**,com.othercompany.**"
excludes_pattern="com.othercompany.projectX.**,com.othercompany.projectY.**"
)
permission.create()

# See repositories, users or groups
permission.repositories
Expand Down

0 comments on commit 9a8d824

Please sign in to comment.