Skip to content
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

Merged
merged 4 commits into from
Sep 24, 2023

Conversation

WebFreak001
Copy link
Member

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.

permissions view
permissions view on mobile
my packages view

only having partial permissions (only trigger manual update):

partial permissions

leave package page:

leave package page

bool isMine;
if (req.session) {
auto userId = User.ID.fromString(req.session.get!string("userID"));
hasManagementAccess = packinfo.hasPermissions(
Copy link

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.

Copy link

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.

Copy link
Member Author

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)

Copy link

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.

@WebFreak001
Copy link
Member Author

ping @s-ludwig

Copy link
Member

@s-ludwig s-ludwig left a 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.

@s-ludwig s-ludwig merged commit 2d1575a into dlang:master Sep 24, 2023
2 checks passed
@WebFreak001 WebFreak001 deleted the shared-owners branch September 24, 2023 17:46
@WebFreak001
Copy link
Member Author

thanks! any chance this gets deployed soon?

@s-ludwig
Copy link
Member

s-ludwig commented Oct 5, 2023

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.

@s-ludwig
Copy link
Member

s-ludwig commented Oct 7, 2023

Latest master is deployed now.

@WebFreak001
Copy link
Member Author

the CSS changes don't seem to have deployed, possibly indicating that also the JS changes might not be deployed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple owners / admins for packages
3 participants