Cláudio Silva (claudioantonio) opened
What considerations about permissions should I consider? Who can create or edit a bug? I found a component that checks if the user is logged in to decide if comments can be added or not. About what kind of login are We talking about? 🤔
MichaelMure commented: At the moment, anyone can create and edit any bugs (including comments they are not the author of). This should change in the future once the identity system become smarter. For now, maybe it's best to match whatever is possible in git-bug core?
Regarding the authentication, there is three different scenario:
- the user might might not have an identity yet (that is, Repository.userIdentity can be nil in GraphQL). In that case we want to have a read-only UI if we don't have a user yet.
- in the future, the webUI might be used for a public portal (possibly with external auth like github OAuth where identities would be imported in git-bug at first login). Again, we want a read-only view when we don't have a user logged in yet.
- the webUI can be started with --read-only to force a read-only view.
So in the react code, the write-enabled part of the UI are guarded with the IfLoggedIn component.