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

Fix the permission of team's Actions unit issue (#24536) #24545

Merged
merged 1 commit into from
May 5, 2023

Conversation

GiteaBot
Copy link
Contributor

@GiteaBot GiteaBot commented May 5, 2023

Backport #24536 by @sillyguodong

close #24449

The unit of Actions should be contorlled not only by repository.DISABLED_REPO_UNITS but also by actions.ENABLED
in the app.ini.
Previously, the permission of the team's Actions unit was not controlled by actions.Enabled. So, even if the user sets actions.Enabled to false, he can still select the permission of the Actions unit for the team.

This PR makes the permissions of the team's Actions unit also controlled by actions.Enabled. Just appendTypeActions into DisabledRepoUnits slice when initializing if actions.Enabled is false.

Changes:

If Actions is set disbaled in app.ini, like below:

[actions]
ENABLED = false
  1. If user try to create/edit a team, will prompt user that Actions is disbaled.

image

  1. actions is not displayed in the sidebar on the team details page

image

close go-gitea#24449

The unit of `Actions` should be contorlled not only by
`repository.DISABLED_REPO_UNITS` but also by `actions.ENABLED`
in the `app.ini`.
Previously, the permission of the team's `Actions` unit was not
controlled by `actions.Enabled`. So, even if the user sets
`actions.Enabled` to false, he can still select the permission of the
`Actions` unit for the team.

This PR makes the permissions of the team's `Actions` unit also
controlled by `actions.Enabled`. Just append`TypeActions` into
`DisabledRepoUnits` slice when initializing if `actions.Enabled` is
false.

### Changes:

If `Actions` is set disbaled in `app.ini`, like below:
```yaml
[actions]
ENABLED = false
```

1. If user try to create/edit a team, will prompt user that `Actions` is disabled.

![image](https://user-images.githubusercontent.com/33891828/236370415-961082b2-82d2-4d9e-8025-83872ad08cbb.png)

2. `actions` is not displayed in the sidebar on the team details page

![image](https://user-images.githubusercontent.com/33891828/236371817-f39f9bc9-5926-4b88-b5e6-d93617fcfb07.png)
@GiteaBot GiteaBot added this to the 1.19.4 milestone May 5, 2023
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 5, 2023
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 5, 2023
@GiteaBot GiteaBot requested review from delvh and lunny May 5, 2023 12:02
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 5, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 5, 2023
@silverwind silverwind merged commit 2572879 into go-gitea:release/v1.19 May 5, 2023
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 3, 2023
@techknowlogick techknowlogick deleted the backport-24536-v1.19 branch September 9, 2023 05:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants