NSSAC / CINES

CINES project repository
Other
1 stars 0 forks source link

File Sharing/Permissions #252

Closed dmachi closed 1 year ago

dmachi commented 3 years ago

We need an interface for modifying file permissions. I would like to see some mockups about how you would see this working.

murli1201 commented 2 years ago

Hi Dustin, I am trying to test the APIs required for file permissions. The status is-

I also tried replacing ['read'] with 'read', changing the path. but nothing changes. I am getting the same response for revoke.

Irrespective of the request parameter, I am always getting an array of 25.

dmachi commented 2 years ago

I don’t think you are supposed to be passing in an array. Instead of grant([ …. ]) it should be grant(“/home/Manvitha/snap12”, [“read”], “dmachi”, true);

https://github.com/NSSAC/sciduct-cli-js/blob/master/bin/sciduct-file-grant#L61

Please try that and let me know if you are still having issues.

Thanks, Dustin

On Oct 20, 2021, at 9:47 AM, murli1201 @.***> wrote:

Hi Dustin, I am trying to test the APIs required for file permissions. The status is-

For grant and revoke API- Request- grant(["/home/Manvitha/snap12",["read"],"dmachi",true]) Response- {id: 10, error: {code: 500, message: "'list' object has no attribute 'split'"}} I also tried replacing ['read'] with 'read', changing the path. but nothing changes. I am getting the same response for revoke.

For queryUsers API- Request- queryUsers("eq(id,re:e)") / queryUsers("eq(id,re:z)") / queryUsers("eq(id,re:u*)") Response- Array[25] Irrespective of the request parameter, I am always getting an array of 25.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NSSAC/CINES/issues/252#issuecomment-947684892, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABOQ3T7Y5SG2NXHUYKKXBLUH3B7HANCNFSM5EOIWPJA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

murli1201 commented 2 years ago

Yes, I did not notice that mistake. Thank you for pointing it out. It is working as expected now.

dmachi commented 2 years ago

The user query is matching the string anywhere inside and I don't think the * should be used.

So we could either do a query like htis, that only matches from the beginning of the string:

or(eq(id,re:^dm),eq(first_name,^dm),eq(last_name,^dm)) or One that matches anywhere within the string: or(eq(id,re:dma),eq(first_name,dma),eq(last_name,dma))

You'll note that the above is searching id, firstname, and last name. I think we probably want the last option.

Finally, this will still return up to 25 users from the backend. I will probably change that in the future. For now you can limit it in the query. So I think we should use something like the following:

or(eq(id,re:d),eq(first_name,d),eq(last_name,d))&limit(5)

murli1201 commented 2 years ago

Yes, now I am able to get the expected results. Thank you.

dmachi commented 2 years ago

I mean we should match anywhere within the field (e.g., "dm") instead of just from the beginning of the string (e.g., "^dm"). So the overall query should look like:

or(eq(id,re:VAL),eq(first_name,re:VAL),eq(last_name,re:VAL))&limit(5)

murli1201 commented 2 years ago

Yes, we will do it this way. The API is working as expected.