forked from kevadesu/forgejo
Allow repo admins too to delete the repo (#23940)
Fixes https://github.com/go-gitea/gitea/issues/23934 We need to check `AccessModeAdmin` in `CanUserDelete` instead of `AccessModeOwner`
This commit is contained in:
parent
36c0840cf1
commit
26a0cd7143
3 changed files with 22 additions and 2 deletions
|
@ -100,6 +100,11 @@ func (org *Organization) IsOwnedBy(uid int64) (bool, error) {
|
|||
return IsOrganizationOwner(db.DefaultContext, org.ID, uid)
|
||||
}
|
||||
|
||||
// IsOrgAdmin returns true if given user is in the owner team or an admin team.
|
||||
func (org *Organization) IsOrgAdmin(uid int64) (bool, error) {
|
||||
return IsOrganizationAdmin(db.DefaultContext, org.ID, uid)
|
||||
}
|
||||
|
||||
// IsOrgMember returns true if given user is member of organization.
|
||||
func (org *Organization) IsOrgMember(uid int64) (bool, error) {
|
||||
return IsOrganizationMember(db.DefaultContext, org.ID, uid)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue