You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/modules/setting
Giteabot 257287954c
Fix the permission of team's `Actions` unit issue (#24536) (#24545)
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 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
disbaled.
 

![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)

Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com>
2 years ago
..
actions.go Refactor the setting to make unit test easier (#22405) 2 years ago
admin.go Refactor the setting to make unit test easier (#22405) 2 years ago
api.go Refactor the setting to make unit test easier (#22405) 2 years ago
attachment.go Add `.patch` to `attachment.ALLOWED_TYPES` (#23580) (#23582) 2 years ago
cache.go Refactor the setting to make unit test easier (#22405) 2 years ago
camo.go Refactor the setting to make unit test easier (#22405) 2 years ago
config_provider.go handle deprecated settings (#22992) 2 years ago
cors.go Fix incorrect CORS default values (#24206) (#24217) 2 years ago
cron.go Refactor the setting to make unit test easier (#22405) 2 years ago
cron_test.go Refactor the setting to make unit test easier (#22405) 2 years ago
database.go Refactor `setting.Database.UseXXX` to methods (#23354) (#23356) 2 years ago
database_sqlite.go Implement FSFE REUSE for golang files (#21840) 2 years ago
database_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
federation.go Refactor the setting to make unit test easier (#22405) 2 years ago
git.go Support reflogs (#22451) (#23438) 2 years ago
highlight.go Refactor the setting to make unit test easier (#22405) 2 years ago
i18n.go Refactor the setting to make unit test easier (#22405) 2 years ago
incoming_email.go Refactor the setting to make unit test easier (#22405) 2 years ago
indexer.go handle deprecated settings (#22992) 2 years ago
indexer_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
lfs.go handle deprecated settings (#22992) 2 years ago
log.go Refactor the setting to make unit test easier (#22405) 2 years ago
mailer.go handle deprecated settings (#22992) 2 years ago
mailer_test.go Refactor the setting to make unit test easier (#22405) 2 years ago
markup.go Refactor the setting to make unit test easier (#22405) 2 years ago
metrics.go Refactor the setting to make unit test easier (#22405) 2 years ago
migrations.go Refactor the setting to make unit test easier (#22405) 2 years ago
mime_type_map.go Refactor the setting to make unit test easier (#22405) 2 years ago
mirror.go handle deprecated settings (#22992) 2 years ago
oauth2.go Refactor the setting to make unit test easier (#22405) 2 years ago
other.go Refactor the setting to make unit test easier (#22405) 2 years ago
packages.go Refactor the setting to make unit test easier (#22405) 2 years ago
packages_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
picture.go Refactor the setting to make unit test easier (#22405) 2 years ago
project.go Refactor the setting to make unit test easier (#22405) 2 years ago
proxy.go Refactor the setting to make unit test easier (#22405) 2 years ago
queue.go Refactor the setting to make unit test easier (#22405) 2 years ago
repository.go Fix the permission of team's `Actions` unit issue (#24536) (#24545) 2 years ago
security.go Refactor the setting to make unit test easier (#22405) 2 years ago
server.go handle deprecated settings (#22992) 2 years ago
service.go Refactor the setting to make unit test easier (#22405) 2 years ago
session.go Refactor the setting to make unit test easier (#22405) 2 years ago
setting.go Fix incorrect CurrentUser check for docker rootless (#24435) 2 years ago
setting_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
ssh.go Refactor the setting to make unit test easier (#22405) 2 years ago
storage.go Make minio package support legacy MD5 checksum (#23768) (#23770) 2 years ago
storage_test.go Refactor the setting to make unit test easier (#22405) 2 years ago
task.go handle deprecated settings (#22992) 2 years ago
time.go Refactor the setting to make unit test easier (#22405) 2 years ago
ui.go Don't set meta `theme-color` by default (#24340) (#24346) 2 years ago
webhook.go Refactor the setting to make unit test easier (#22405) 2 years ago