Skip to content

[#561] implementation: get_maximum_permissions_for_path - #602

Open
d-w-moore wants to merge 11 commits into
irods:mainfrom
d-w-moore:561.m
Open

d-w-moore wants to merge 11 commits into
irods:mainfrom
d-w-moore:561.m

Conversation

@d-w-moore

Copy link
Copy Markdown
Collaborator

Check if the user named (may be a user or group) has privilege at or above the given access_level to the collection or data object named by path

@d-w-moore

Copy link
Copy Markdown
Collaborator Author

Needs test.

@d-w-moore
d-w-moore marked this pull request as draft August 2, 2024 04:59
@d-w-moore

Copy link
Copy Markdown
Collaborator Author

Looks as if we won't implement this, at least not in this way. close?

@alanking

alanking commented Dec 2, 2024

Copy link
Copy Markdown
Contributor

I vote we leave it open / in draft until an alternative implementation presents itself. Is there a reason you want to close this?

@d-w-moore

Copy link
Copy Markdown
Collaborator Author

I vote we leave it open / in draft until an alternative implementation presents itself. Is there a reason you want to close this?

No reason. I think we decided it's best implemented as a specific query.

@korydraughn

Copy link
Copy Markdown
Contributor

We need to do more investigative work for #561.

Let's keep this in draft for now. We can circle back once the 3.0.0 milestone is complete.

@d-w-moore

Copy link
Copy Markdown
Collaborator Author

Hm. Looks like I force-pushed over the old branch. Note for the future, don't do that. (Look for pre-existence of the branch name in GitHub. Duh.)

Well, luckily I am very confident of the new code being better....

@d-w-moore d-w-moore self-assigned this Oct 25, 2026
@d-w-moore d-w-moore changed the title [#561] experimental implementation: user_has_access [#561] implementation: get_maximum_permissions_for_path Oct 25, 2026
@d-w-moore

Copy link
Copy Markdown
Collaborator Author

Will mark ready for review once I've run the tests through with rudra's changes included

@d-w-moore
d-w-moore marked this pull request as ready for review October 26, 2026 17:12
Comment thread irods/manager/access_manager.py Resolved
Comment thread irods/manager/access_manager.py Resolved
Comment thread irods/manager/access_manager.py Resolved
Comment thread irods/manager/access_manager.py Resolved
Comment thread irods/manager/access_manager.py Resolved
Comment thread irods/manager/access_manager.py Resolved
Comment thread irods/manager/access_manager.py Resolved
Comment thread irods/access.py Resolved
Comment thread irods/query.py Resolved
@d-w-moore

Copy link
Copy Markdown
Collaborator Author

Cleaned up a bit. Will test soon. Hold off from further review until tests are passing.

@d-w-moore
d-w-moore force-pushed the 561.m branch 3 times, most recently from 69a65ac to 68143c1 Compare November 9, 2026 22:12
@korydraughn

Copy link
Copy Markdown
Contributor

What is the current status of this?

I see one unresolved review comment and a few github action workflow failures.

@d-w-moore

Copy link
Copy Markdown
Collaborator Author

@korydraughn I've been out Monday due to ill health but am getting back to it now. I see that there are source code issues to be addressed and have resolved the one comment. Will work on it today.

@d-w-moore

Copy link
Copy Markdown
Collaborator Author

squashed

@korydraughn

Copy link
Copy Markdown
Contributor

A test involving datetime failed. See https://github.com/irods/python-irodsclient/actions/runs/46281195999/job/141403524834?pr=602.

Please investigate.

Also, the commit message body of 6187c1f and db52401 seem incomplete?

@d-w-moore

d-w-moore commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

A test involving datetime failed. See https://github.com/irods/python-irodsclient/actions/runs/46281195999/job/141403524834?pr=602.

Please investigate.

Also, the commit message body of 6187c1f and db52401 seem incomplete?

Under conditions (and it must be a server race condition, I believe, as all the client does is to invoke the DATA_OBJ_CREATE_AN api) the test fails every 10 tries or on that order, due to the modify timestamp on a newly created data object being (almost always 1 second) more recent than the create time. So, ... unrelated to the issue at hand.

Those two commits with incomplete messages probably need update locally? They've been squashed out and force-pushed over, in the github repo, as far as I can see.

@d-w-moore

Copy link
Copy Markdown
Collaborator Author

Under conditions (and it must be a server race condition, I believe, as all the client does is to invoke the DATA_OBJ_CREATE_AN api) the test fails every 10 tries or on that order, due to the modify timestamp on a newly created data object being (almost always 1 second) more recent than the create time. So, ... unrelated to the issue at hand.

i wonder if there's a way to try that api apart from PRC. Does itouch use it when creating a new object?

@korydraughn

Copy link
Copy Markdown
Contributor

itouch doesn't use the DataObjCreate API. It uses the Touch API.

If the datetime test failures are unrelated to these changes, open an issue for the failures so that we can address it in a separate PR. No need to block this one for that.

Those two commits with incomplete messages probably need update locally? They've been squashed out and force-pushed over, in the github repo, as far as I can see.

It's not clear to me what you mean by squashed out and force-pushed over. Does your local branch reflect the commit messages shown in this PR?

When I expand the commit messages for 6187c1f and db52401, I see the following.

[_843] iRODSGroup - proper zone handling
user_manager
[_847] user equality operator (for group membership test)
user-rel

user-nonrel

@d-w-moore

d-w-moore commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator Author

itouch doesn't use the DataObjCreate API. It uses the Touch API.

If the datetime test failures are unrelated to these changes, open an issue for the failures so that we can address it in a separate PR. No need to block this one for that.

Those two commits with incomplete messages probably need update locally? They've been squashed out and force-pushed over, in the github repo, as far as I can see.

It's not clear to me what you mean by squashed out and force-pushed over. Does your local branch reflect the commit messages shown in this PR?

When I expand the commit messages for 6187c1f and db52401, I see the following.

[_843] iRODSGroup - proper zone handling
user_manager
[_847] user equality operator (for group membership test)
user-rel

user-nonrel

Ok I see now, you are correct. They were not removed, just not a part of the organizational timeline for the repo yet. This was what I saw (and still see) up top, when I click on those links:

Screenshot from 2026-11-30 13-57-50

That looks like a new thing to me. Not sure why they put that at the header of those commit pages, since seems to me it should be easy for GitHub to trace through the PR to the branch it refers to, and come up with the proper conclusions.

@korydraughn

Copy link
Copy Markdown
Contributor

When you go to your fork, do you see the SHAs I referenced in the branch?

Evince the zone attribute of iRODSGroup objects.  This attribute will
always reflect the local zone name, since remote iRODS groups have no
meaningful representation outside their own zones.
Provide __eq__ methods appropriate for iRODSUser and iRODSGroup objects.
This also allows (iRODSUser_instance in iRODSGroup.members) to properly
indicate user membership in a group.
A query is done to determine the highest permission level the given user
(or group) has on the target collection/data_object.

A specific query will be used if the calling user has the availability,
otherwise a reasonably efficient general query is used instead.
@d-w-moore

Copy link
Copy Markdown
Collaborator Author

They were at the time that the warning appeared. Probably no longer. There's been a force push as of this morning too, which reorganized some changes, but the overall changes only involve changing other_group to other_group_or_user in an __eq__ method and adding a test.

@korydraughn korydraughn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the commits that focus on iRODSGroup and zones introduce breaking changes?

Comment thread irods/manager/access_manager.py Resolved
Comment on lines +737 to +740

# Prior to fix, this would raise MultipleResultsFound
bob = self.sess.groups.get("bob")
finally:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this test needs to assert that bob is bob#<local_zone>. As it currently is, we don't know which bob is represented.

This test (or another one) should also verify that remote users can be identified.

@d-w-moore d-w-moore Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test (or another one) should also verify that remote users can be identified.

You mean it should verify that they can be retrieved from the catalog without error? I can add that pretty easily.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants