Users unable to make their own repos as public #6845

Open
opened 2025-11-02 07:08:28 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @zuhairamahdi on GitHub (Feb 11, 2021).

  • Gitea version (or commit ref): 1.12.0
  • Git version:
  • Operating system: Windows
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

we are forcing to make the repo initially to be private but after creation. The users who are not admin are unable to make their repos to be public.

Screenshots

Originally created by @zuhairamahdi on GitHub (Feb 11, 2021). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> - Gitea version (or commit ref): 1.12.0 - Git version: - Operating system: Windows <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [x] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - Log gist: <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description we are forcing to make the repo initially to be private but after creation. The users who are not admin are unable to make their repos to be public. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/proposal label 2025-11-02 07:08:28 -06:00
Author
Owner

@zeripath commented on GitHub (Feb 11, 2021):

To be clear, you have set FORCE_PRIVATE to true in your app.ini?

FORCE_PRIVATE is behaving exactly as expected. Only admin users can make repos public in that situation.

If you want people to only create their repos and private then later make them public either use DEFAULT_PRIVATE=private so it's an active choice to make things public or... more hackily change the template to remove to always send private as a hidden input.

@zeripath commented on GitHub (Feb 11, 2021): To be clear, you have set FORCE_PRIVATE to true in your app.ini? FORCE_PRIVATE is behaving exactly as expected. Only admin users can make repos public in that situation. If you want people to only create their repos and private then later make them public either use DEFAULT_PRIVATE=private so it's an active choice to make things public or... more hackily change the template to remove to always send private as a hidden input.
Author
Owner

@zuhairamahdi commented on GitHub (Feb 11, 2021):

@zeripath

thanks for your reply. the issue is that we want to keep FORCE_PRIVATE for organizations repos (non but admins) but for individuals we want users to change their repos to and from public and private.

@zuhairamahdi commented on GitHub (Feb 11, 2021): @zeripath thanks for your reply. the issue is that we want to keep FORCE_PRIVATE for organizations repos (non but admins) but for individuals we want users to change their repos to and from public and private.
Author
Owner

@zeripath commented on GitHub (Feb 11, 2021):

So it's not that there's a bug - you want another feature 😀

Ok. Spec it out.

Is it more that actually you want to have another permission layer in organisation: create public repository? Or is it a site wide i.e. no public repos in organisations unless site wide admin makes em.

My suspicion is that you want the first.

@zeripath commented on GitHub (Feb 11, 2021): So it's not that there's a bug - you want another feature 😀 Ok. Spec it out. Is it more that actually you want to have another permission layer in organisation: create public repository? Or is it a site wide i.e. no public repos in organisations unless site wide admin makes em. My suspicion is that you want the first.
Author
Owner

@zuhairamahdi commented on GitHub (Feb 11, 2021):

@zeripath
the idea is to prevent organization users to create public repositories (except for site wide admin) while allow individuals to create public or private repos for them self.

for example:

  • 'Zuhair' is a user that is part of an organization: I might be able to create a new repo in the organization but I should not be able to make the organization repo to be public (it should always be private unless I'm a system wide admin to mark it as public).
  • 'Zuhair' should be able to create repos under his account and mark them as public or private as he like.
@zuhairamahdi commented on GitHub (Feb 11, 2021): @zeripath the idea is to prevent organization users to create public repositories (except for site wide admin) while allow individuals to create public or private repos for them self. for example: - 'Zuhair' is a user that is part of an organization: I might be able to create a new repo in the organization but I should not be able to make the organization repo to be public (it should always be private unless I'm a system wide admin to mark it as public). - 'Zuhair' should be able to create repos under his account and mark them as public or private as he like.
Author
Owner

@silverwind commented on GitHub (Nov 3, 2021):

If this is added, it should be a separare option, defaulting to disabled. In our situation it is highly desirable that users can not switch repos to public when repo.FORCE_PRIVATE is enabled.

@silverwind commented on GitHub (Nov 3, 2021): If this is added, it should be a separare option, defaulting to disabled. In our situation it is highly desirable that users can not switch repos to public when `repo.FORCE_PRIVATE` is enabled.
Author
Owner

@lunny commented on GitHub (Nov 3, 2021):

This should be a setting on organization to force private that admin team of organization could change it on the UI, just like we have did in app.ini.

@lunny commented on GitHub (Nov 3, 2021): This should be a setting on organization to force private that admin team of organization could change it on the UI, just like we have did in app.ini.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6845