-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Allow admins and org owners to change org member public status #28294
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
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a1012112796
approved these changes
Dec 6, 2023
Use |
@yp05327 Like this? |
Can be simpler. if userToPublicize.ID != ctx.Doer.ID && !ctx.Doer.IsAdmin {
isOwner, err := ctx.Org.Organization.IsOwnedBy(ctx, ctx.Doer.ID)
if err != nil {
ctx.Error(http.StatusInternalServerError, "IsOwnedBy", err)
return
}
if !isOwner {
ctx.Error(http.StatusForbidden, "", "Cannot publicize another member")
return
}
} |
@yp05327 That is indeed better, updated. Thanks for the suggestion. |
lunny
reviewed
Feb 2, 2024
lunny
reviewed
Feb 2, 2024
If there could be some tests, and I could vote my approval. |
# Conflicts: # routers/api/v1/org/member.go
Added some tests in 6e9b8a9 |
wxiaoguang
approved these changes
Apr 13, 2025
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Apr 14, 2025
* giteaofficial/main: (27 commits) fix github migration error when using multiple tokens (go-gitea#34144) Add package version api endpoints (go-gitea#34173) Fix incorrect file links (go-gitea#34189) Add cache for common package queries (go-gitea#22491) Allow admins and org owners to change org member public status (go-gitea#28294) Fix span svg layout (go-gitea#34185) fix webhook url (go-gitea#34186) Optimize overflow-menu (go-gitea#34183) Move and rename UpdateRepository (go-gitea#34136) Update milestones.tmpl (go-gitea#34184) [skip ci] Updated translations via Crowdin Refactor Git Attribute & performance optimization (go-gitea#34154) [skip ci] Updated translations via Crowdin fix(go-gitea#33711): cross-publish docker images to ghcr.io (go-gitea#34148) refactor organization menu (go-gitea#33928) feat: Add sorting by exclusive labels (issue priority) (go-gitea#33206) Fix vertical centering of file tree icons and use entryIcon for submodules/symlinks (go-gitea#34137) bugfix check for alternate ssh host certificate location (go-gitea#34146) Cache GPG keys, emails and users when list commits (go-gitea#34086) Set MERMAID_MAX_SOURCE_CHARACTERS to 50000 (go-gitea#34152) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
modifies/api
This PR adds API routes or modifies them
modifies/go
Pull requests that update Go code
type/enhancement
An improvement of existing functionality
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allows admins and org owners to change org member public status.
Before, this would return
Error 403: Cannot publicize another member
despite the fact that the same user could make the same change through the GUI.Fixes #28372