sandstorm-io / sandstorm

Sandstorm is a self-hostable web productivity suite. It's implemented as a security-hardened web app package manager.
https://sandstorm.io
Other
6.72k stars 705 forks source link

Ability to chown grains #988

Open ndarilek opened 8 years ago

ndarilek commented 8 years ago

I would like the ability to change a grain's owner. I'm considering using Sandstorm for a set of loosely-defined organizations from which members may come and go. A member might, say, create an Etherpad document, then leave later. They may not want the doc cluttering up their workspace, but we may need it as part of our organization. Similarly, we may wish to create administrative accounts that own official organizational documents, but only change a document's ownership when we decide to upgrade it from "pet project" to official status.

I know this can be accomplished administratively, but perhaps a "Change owner" button that generates a request to an account chosen from those which have access. If the receiving account approves the request, the grain's owner is changed. Maybe the original owner can be given whatever permissions the new owner had, or permissions of the new owner's choosing when the request is approved.

tebanep commented 8 years ago

+1

keypair commented 7 years ago

just had this problem. ability to change ownership of grains or ownership of user (via setting email) is absolutely necessary in any organization. now looking again how to edit the database.

ocdtrekkie commented 3 years ago

@zenhack Here's the tracking issue for this one. As said in the other discussion, top questions are what happens to the graph of people the original owner shared with, and what permissions the original owner gets after transfer.

zenhack commented 3 years ago

Re: the original graph, I think nothing should happen to it -- I don't think this even interacts with the access stuff.

For the original owner, my instinct is we should grant them the broadest permission set possible to start with; they can either drop the grain or the new owner can revoke their permissions if something less is desired.

ocdtrekkie commented 3 years ago

So, doesn't everyone's share link explicitly define who shared it with them? Which means you'd have a tree of shares starting at the grain owner, if you mapped it out?

Also, roles in Sandstorm let you configure some pretty arbitrary arrangements of permissions, I am unsure we have a programmatic way to determine "the most permissions" that would make sense for all scenarios. Which is why I am thinking we may need to allow the transferrer to set their role post-transfer.

zenhack commented 3 years ago

So the other weird thing is that permissions are actually per UiView, not per grain.

It probably would be easier to just have a dropdown for the role to assign yourself after transfer; we could union all the permission bits, but that could in principle get you a set of permissions that isn't a "role," which is weird.

You're right about the tree, though I think it would "just work" provided that the old owner still has access. We could take two approaches here:

  1. Leave this as-is.
  2. Re-root the sharing tree onto the new owner.

(2) avoids a possible footgun where somebody is leaving the organization, so they transfer the grain to somebody else as an owner, then that person revokes the original owner's access, accidentally revoking everyone's access transitively.

I think if we were going to do (1) I might want to have a tree-view of permissions, and the ability to re-root children rather than revoking when a parent in the tree is revoked. So maybe we should re-root at least for the first version of this.

ocdtrekkie commented 3 years ago

Yeah, I think one of those ideal grain settings features is being able to see this tree in its entirety, which would make good decisions easier for people messing with sharing permissions.

zenhack commented 3 years ago

(Fwiw, this was on my shortlist of things to work on anyway; I have several grains that I would like to delete from my own grain list but can't because I shared them with other people and I don't want to revoke access. I wish I could just give them the grain).

zenhack commented 3 years ago

Had some other thoughts re: what to do for role assignment of the original owner:

Thoughts?

ocdtrekkie commented 3 years ago

Hmmm, I'm a bit worried about the UI complexity of an approval flow, but that's probably an "right" way to handle it. Depending on the grain, I can imagine scenarios where a user being "given" ownership without consent could be problematic.

zenhack commented 3 years ago

(It is especially problematic if the server enforces quotas: here, you pay for this).

ocdtrekkie commented 3 years ago

Yeah, we don't have many Sandstorm servers changing by quota, to my knowledge, but I see additional concerns with putting say, illegal material in a grain and then giving ownership to someone. Or even just using it as a way to transfer spam into their grain list...

zenhack commented 3 years ago

Quoting Jacob Weisz (2021-09-20 02:40:10)

Or even just using it as a way to transfer spam into their grain list...

I mean, even this much is theoretically already a problem with just sharing.