gitea/modules/setting
sillyguodong a866cb0cb9
Fix the permission of team's `Actions` unit issue (#24536)
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 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)
2023-05-05 20:02:30 +08:00
..
actions.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
admin.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
api.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
asset_dynamic.go Use a general approach to access custom/static/builtin assets (#24022) 2023-04-12 18:16:45 +08:00
asset_static.go Use a general approach to access custom/static/builtin assets (#24022) 2023-04-12 18:16:45 +08:00
attachment.go Add `.patch` to `attachment.ALLOWED_TYPES` (#23580) 2023-03-19 15:58:43 -04:00
cache.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
camo.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
config_provider.go Merge setting.InitXXX into one function with options (#24389) 2023-05-04 11:55:35 +08:00
cors.go Fix incorrect CORS default values (#24206) 2023-04-19 15:30:10 -04:00
cron.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
cron_test.go Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
database.go Move pidfile creation from setting to web cmd package (#23285) 2023-03-16 15:22:54 +08:00
database_sqlite.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
database_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
federation.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
git.go Support reflogs (#22451) 2023-03-13 15:51:07 +08:00
highlight.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
i18n.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
incoming_email.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
indexer.go Add meilisearch support (#23136) 2023-03-28 22:23:23 -04:00
indexer_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
lfs.go Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
log.go Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
mailer.go handle deprecated settings (#22992) 2023-02-20 16:18:26 -06:00
mailer_test.go Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
markup.go Add .livemd as a markdown extension (#22730) 2023-04-26 11:22:54 -04:00
metrics.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
migrations.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
mime_type_map.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
mirror.go handle deprecated settings (#22992) 2023-02-20 16:18:26 -06:00
oauth2.go Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
other.go Refactor `setting.Other` and remove unused `SHOW_FOOTER_BRANDING` (#24270) 2023-04-22 19:38:25 -04:00
packages.go Add Debian package registry (#24426) 2023-05-02 12:31:35 -04:00
packages_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
picture.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
project.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
proxy.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
queue.go Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
repository.go Fix the permission of team's `Actions` unit issue (#24536) 2023-05-05 20:02:30 +08:00
security.go Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
server.go handle deprecated settings (#22992) 2023-02-20 16:18:26 -06:00
service.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
session.go Refactor cookie (#24107) 2023-04-13 15:45:33 -04:00
setting.go Merge setting.InitXXX into one function with options (#24389) 2023-05-04 11:55:35 +08:00
setting_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
ssh.go Prefer native parser for SSH public key parsing (#23798) 2023-04-11 14:34:28 +08:00
storage.go Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
storage_test.go Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
task.go handle deprecated settings (#22992) 2023-02-20 16:18:26 -06:00
time.go Remove unused setting `time.FORMAT` (#24430) 2023-04-29 22:51:43 +02:00
ui.go Don't set meta `theme-color` by default (#24340) 2023-04-26 00:56:42 -04:00
webhook.go Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00