Skip to content

[#561] implementation: get_maximum_permissions_for_path - #602

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

d-w-moore wants to merge 14 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

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
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 Outdated
Comment on lines +121 to +132
# Find out if the query is already registered.
try:
specific_query = SpecificQuery(ses, alias='findQueryByAlias', args=('getMaximumPermissionForPath',))
specific_query.execute()
except CAT_NO_ROWS_FOUND:
specific_query = None
else:
specific_query = SpecificQuery(ses, alias='getUserAccessType', args=specific_query_args)

# If there is no canned query available, and we are a rodsadmin, then install our own:
if not specific_query and ses.users.get(ses.username).type == 'rodsadmin':
specific_query = UserAccessTypeQuery(ses, args=specific_query_args)

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.

Auto-installing a specific query is not how we've done things in the past.

We should just try to use it and if it's there, we're good. If not, use the fallback implementation. No need to test for existence.

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.

but this is better for testing, in the mean time, so it might be better to leave it there until an iRODS release containing the new specific query.

@korydraughn korydraughn Oct 27, 2026 •

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.

If it's for test purposes, have the test explicitly add/remove the SpecificQuery. It's fine if the test tests for existence of the SpecificQuery before adding/removing it.

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 is done now! Just need to run through the test to check. Will do this before monday morning.

Comment thread irods/manager/access_manager.py Resolved
Comment thread irods/manager/access_manager.py Resolved
Comment thread irods/manager/access_manager.py Outdated
Comment on lines +91 to +92
coll=None,
data=None,

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.

Consider using more letters for the parameter names.

coll is pretty obvious, but data isn't.

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.

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