Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 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
889b5c1
ruff stuff
d-w-moore Mar 30, 2026
34980b3
docstring stuff
d-w-moore Apr 5, 2026
83e16e6
hash function for ACLOperation
d-w-moore Apr 1, 2026
7792dfc
extra normalizer method "normal" and consistent eq/hash semantics for…
d-w-moore Apr 2, 2026
cf32240
ruff reformat of previous commit
d-w-moore Apr 2, 2026
6eac4f7
doc string fixes
d-w-moore Apr 2, 2026
16e2a28
docstring reformat
d-w-moore Apr 2, 2026
4bf90b1
alter parameter; zone name instead of session
d-w-moore Apr 2, 2026
b61a820
more ruff stuff
d-w-moore Apr 2, 2026
b365440
general noqa directives
d-w-moore Apr 5, 2026
11d8e92
delete surrounding ws
d-w-moore Apr 5, 2026
957d390
correct spelling
d-w-moore Apr 5, 2026
72492f5
test ruff: noqa
d-w-moore Apr 6, 2026
4618440
irods/exceptions - ruff
d-w-moore Apr 6, 2026
f0542d8
disable trivial ruff reports for exception classes
d-w-moore Apr 6, 2026
af08c63
ruff format
d-w-moore Apr 6, 2026
bbb1ff3
delete blanket noqa
d-w-moore Apr 6, 2026
f08bfbb
noqa comment in wrong place? experimenting....
d-w-moore Apr 6, 2026
e0df45f
block noqa suppressions
d-w-moore Apr 6, 2026
0d64c93
D400 corrrection
d-w-moore Apr 6, 2026
789b1f5
D400 corrrection correction
d-w-moore Apr 6, 2026
a0de44f
Revert "D400 corrrection correction"
d-w-moore Apr 6, 2026
789f4cb
Revert "D400 corrrection"
d-w-moore Apr 6, 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