-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement sharing packages to other users #550
Conversation
the APIs are already usable, but this makes the UI also show the interface to edit the data easily.
82ec573
to
976c9cb
Compare
bool isMine; | ||
if (req.session) { | ||
auto userId = User.ID.fromString(req.session.get!string("userID")); | ||
hasManagementAccess = packinfo.hasPermissions( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know much about the context of those files but this line looks a little strange to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, other than that, I didn't noticed anything strange in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is used to show the "Edit this package" button on the view package page - since we potentially don't have a user, we need to fetch it from the session here. The userId / session reading code is just moved from inside the .dt template into the .d file here. The first hasPermissions check checks if we should show the button, the second checks if the package is owned by the logged in user (to show a different text below the button)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yea, what I found strange was using the readonly
permission for hasManagementAccess, it looked very strange.
ping @s-ludwig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure that I already reviewed this and was basically okay with everything, but got distracted and forgot to finish the review. The only thing that would be nice to use here is the role functionality of vibe.web's authorization system, but we can target that for a later refactoring.
thanks! any chance this gets deployed soon? |
I'll upload a new build! Can you have a quick look at the two additions in #553? I could then also look into whether we can enable gitea.com public repositories. |
Latest master is deployed now. |
the CSS changes don't seem to have deployed, possibly indicating that also the JS changes might not be deployed. |
fixes #536
I didn't add transferring package ownership, since I wanted to rather do that with an "accept" system, so that you won't suddenly become owner of random spam packages, and felt like that was out of scope / too big here.
only having partial permissions (only trigger manual update):
leave package page: