Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7a81184
add SYS_INTERNAL_ERR
d-w-moore Mar 20, 2026
228bf86
[_505,sq] atomic ACLs endpoint
d-w-moore Mar 19, 2026
fb6e373
misc corrections / ruff lint and format
d-w-moore Mar 21, 2026
1b2e7e1
convert "codes" and "strings" into properties of the class to prevent…
d-w-moore Mar 27, 2026
32f6a24
ruff related changes
d-w-moore Mar 27, 2026
e373423
[_809] deprecate class for storing permission codes pre-iRODS-4.3
d-w-moore Mar 27, 2026
6421829
README updates
d-w-moore Mar 27, 2026
8397b34
update test name to include _issue_
d-w-moore Mar 28, 2026
5b1c514
README example for normalization before comparison of acl-like objects
d-w-moore Mar 29, 2026
e565b16
add true ACLOperation/iRODSAccess canonicalization for api calls and …
d-w-moore Mar 29, 2026
b9c4088
correct README again
d-w-moore Mar 30, 2026
fe51e78
README ':'->'.'
d-w-moore Mar 30, 2026
375ab0d
whitespace
d-w-moore Mar 30, 2026
c57620e
improve README phrasing
d-w-moore Mar 30, 2026
a808b38
correct README examples
d-w-moore Mar 30, 2026
b566894
drop use of 'ichmod' in identifiers
d-w-moore Mar 30, 2026
4120862
add permissions in README section title
d-w-moore Mar 30, 2026
6192eae
correct docstring.
d-w-moore Mar 30, 2026
762d2bd
delay import of deprecated class until latest possible point of need
d-w-moore Mar 31, 2026
5a1a4bc
ruff-1
d-w-moore Apr 1, 2026
0e66f31
reformat /docstrings - ruff
d-w-moore Apr 1, 2026
b7e41e4
formatting
d-w-moore Apr 1, 2026
2490f12
run ruff format --preview
d-w-moore Apr 1, 2026
84ad371
hash function for ACLOperation
d-w-moore Apr 1, 2026
cf64e4a
extra normalizer method "normal" and consistent eq/hash semantics for…
d-w-moore Apr 2, 2026
22f4ffd
ruff reformat of previous commit
d-w-moore Apr 2, 2026
9311683
doc string fixes
d-w-moore Apr 2, 2026
e6196c2
docstring reformat
d-w-moore Apr 2, 2026
dcaf1d6
alter parameter; zone name instead of session
d-w-moore Apr 2, 2026
15d09e8
ruff nr. 3
d-w-moore Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2118,6 +2118,66 @@ membership, this can be achieved with another query.
`<session>.permissions` was therefore removed in v2.0.0
in favor of `<session>.acls`.

Atomically setting permissions
------------------------------

A list of permissions may be added to an object atomically using
the AccessManager's `apply_atomic_operations` method:
```py
from irods.access import ACLOperation
from irods.helpers import home_collection
session = irods.helpers.make_session()
myCollection = session.collections.create(f"{home_collection(session)}/newCollection")

session.acls.apply_atomic_operations(
myCollection.path,
*[
ACLOperation("read", "public"),
ACLOperation("write", "bob", "otherZone")
]
)
```
`ACLOperation` objects form a linear order with `iRODSAccess` objects, and
indeed are subclassed from them as well, allowing equivalence comparisons and
also permitting intermixed sequences to be sorted (using the `__lt__` method
if no sort `key` parameter is given).

Care should be taken however to normalize the objects before such comparisons
and sorting, and with connected uses of the `in` operator (which leverages `__eq__`).

The following code sorts the objects based on their lexical order starting with the
normalized `access_name`, which serves to group identical permissions together:
```py
from irods.access import *
import irods.helpers
acls = [
iRODSAccess('read_object', '/tempZone/home/alice', 'bob', 'tempZone'),
ACLOperation('write', 'rods'),
ACLOperation('read', 'bob'),
]

session = irods.helpers.make_session()
normalize = lambda acl: acl.normal(local_zone=session.zone)

print(normalize(acls[0]) == normalize(acls[2]))
acls.sort(key=normalize)
print(normalize(iRODSAccess('read', '', 'bob')) in map(normalize,acls))
```

If strict order of permissions is desired, we can use code such as the following:
```py
from irods.access import *
from pprint import pp
pp(sorted(
[
ACLOperation('read', 'bob' ),
ACLOperation('own', 'rods'),
ACLOperation('read_object', 'alice')
],
key=lambda acl: (all_permissions[acl.access_name], acl.normal())
))
```

Quotas (v2.0.0)
---------------

Expand Down
Loading
Loading