Zipstack / unstract

No-code LLM Platform to launch APIs and ETL Pipelines to structure unstructured documents
https://unstract.com
GNU Affero General Public License v3.0
354 stars 30 forks source link

Added condition to check adapter is shared to org #363

Closed johnyrahul closed 1 month ago

johnyrahul commented 1 month ago

What

Why

How

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

Database Migrations

Env Config

Relevant Docs

-

Related Issues or PRs

-

Dependencies Versions

-

Notes on Testing

Screenshots

Checklist

I have read and understood the [Contribution Guidelines]().

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

johnyrahul commented 1 month ago

LGTM - @johnyrahul what's the difference between llm.shared_to_org and llm.shared_users.filter(pk=profile_manager_owner.pk).exists() ? Do we do such permission based checks in tools also for org access?

@chandrasekharan-zipstack frictionless adapters are adapters which is shared across the org. There can be scenarios where users create certain adapters, which will only be shared with a subset of users. That is where the shared user comes into the picture.

chandrasekharan-zipstack commented 1 month ago

LGTM - @johnyrahul what's the difference between llm.shared_to_org and llm.shared_users.filter(pk=profile_manager_owner.pk).exists() ? Do we do such permission based checks in tools also for org access?

@chandrasekharan-zipstack frictionless adapters are adapters which is shared across the org. There can be scenarios where users create certain adapters, which will only be shared with a subset of users. That is where the shared user comes into the picture.

While exporting a project - when a user selects share to all -> do we set llm.share_to_org as True? Or do we add entries to llm.shared_users ? Also I hope we're clear on cases where users leave / join the org as well

johnyrahul commented 1 month ago

LGTM - @johnyrahul what's the difference between llm.shared_to_org and llm.shared_users.filter(pk=profile_manager_owner.pk).exists() ? Do we do such permission based checks in tools also for org access?

@chandrasekharan-zipstack frictionless adapters are adapters which is shared across the org. There can be scenarios where users create certain adapters, which will only be shared with a subset of users. That is where the shared user comes into the picture.

While exporting a project - when a user selects share to all -> do we set llm.share_to_org as True? Or do we add entries to llm.shared_users ? Also I hope we're clear on cases where users leave / join the org as well

@chandrasekharan-zipstack the resource shared is the exported tool during the sharing scenario that you mentioned, not the LLM. I hope I haven't confused you.

chandrasekharan-zipstack commented 1 month ago

LGTM - @johnyrahul what's the difference between llm.shared_to_org and llm.shared_users.filter(pk=profile_manager_owner.pk).exists() ? Do we do such permission based checks in tools also for org access?

@chandrasekharan-zipstack frictionless adapters are adapters which is shared across the org. There can be scenarios where users create certain adapters, which will only be shared with a subset of users. That is where the shared user comes into the picture.

While exporting a project - when a user selects share to all -> do we set llm.share_to_org as True? Or do we add entries to llm.shared_users ? Also I hope we're clear on cases where users leave / join the org as well

@chandrasekharan-zipstack the resource shared is the exported tool during the sharing scenario that you mentioned, not the LLM. I hope I haven't confused you.

Ah okay got it - I was thinking we have a share to org feature itself supported for adapters. Seems like its not present so no concerns here image

PS: Do you think its a good idea to bring this feature of share to entire org in the context of adapters / prompt studio projects? @arun-venkataswamy @hari-kuriakose @johnyrahul