forgejo/modules
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 show workflow config error on file view also (#24267) 2023-04-22 22:16:54 -04:00
activitypub
analyze
assetfs Use a general approach to access custom/static/builtin assets (#24022) 2023-04-12 18:16:45 +08:00
auth Use a general approach to access custom/static/builtin assets (#24022) 2023-04-12 18:16:45 +08:00
avatar Allow webp images as avatars (#24248) 2023-04-21 13:15:49 -04:00
base
cache Update redis library to support redis v7 (#24114) 2023-04-13 18:41:04 -04:00
charset Update go tool dependencies, restructure lint targets (#24239) 2023-04-22 14:53:00 -04:00
container
context Improve template system and panic recovery (#24461) 2023-05-04 14:36:34 +08:00
csv Refactor locale number (#24134) 2023-04-17 11:37:23 +08:00
doctor Merge setting.InitXXX into one function with options (#24389) 2023-05-04 11:55:35 +08:00
emoji
eventsource
generate
git Faster git.GetDivergingCommits (#24482) 2023-05-04 05:08:41 +00:00
gitgraph
graceful Remove most path-based golangci exclusions (#24214) 2023-04-19 22:08:01 -04:00
hcaptcha
highlight
hostmatcher
html
httpcache
httplib
indexer Refactor config provider (#24245) 2023-04-25 23:06:39 +08:00
issue/template
json
label Make label templates have consistent behavior and priority (#23749) 2023-04-10 16:44:02 +08:00
lfs Use more specific test methods (#24265) 2023-04-22 17:56:27 -04:00
log Enable forbidigo linter (#24278) 2023-04-24 05:50:58 -04:00
markup Merge setting.InitXXX into one function with options (#24389) 2023-05-04 11:55:35 +08:00
mcaptcha
metrics
migration
mirror
nosql Update redis library to support redis v7 (#24114) 2023-04-13 18:41:04 -04:00
notification
options Use a general approach to access custom/static/builtin assets (#24022) 2023-04-12 18:16:45 +08:00
packages Add Debian package registry (#24426) 2023-05-02 12:31:35 -04:00
paginator Use more specific test methods (#24265) 2023-04-22 17:56:27 -04:00
pprof
private Fix incorrect internal response type (#24173) 2023-04-17 23:10:40 -04:00
process
proxy
proxyprotocol
public Use a general approach to access custom/static/builtin assets (#24022) 2023-04-12 18:16:45 +08:00
queue Fix intermittent CI failure in EmptyQueue (#23753) 2023-05-03 21:37:30 -04:00
recaptcha
references
regexplru
repository Fix unclear IsRepositoryExist logic (#24374) 2023-04-28 14:14:26 -04:00
secret Use more specific test methods (#24265) 2023-04-22 17:56:27 -04:00
session Update redis library to support redis v7 (#24114) 2023-04-13 18:41:04 -04:00
setting Fix the permission of team's Actions unit issue (#24536) 2023-05-05 20:02:30 +08:00
sitemap
ssh
storage Use more specific test methods (#24265) 2023-04-22 17:56:27 -04:00
structs Add API for gitignore templates (#22783) 2023-04-27 11:51:20 +08:00
svg Use a general approach to access custom/static/builtin assets (#24022) 2023-04-12 18:16:45 +08:00
sync
system
templates Improve template system and panic recovery (#24461) 2023-05-04 14:36:34 +08:00
test Improve template system and panic recovery (#24461) 2023-05-04 14:36:34 +08:00
timeutil Fix incorrect webhook time and use relative-time to display it (#24477) 2023-05-03 19:53:43 -04:00
translation Make repo size style matches others (commits/branches/tags) (#24408) 2023-04-28 17:23:19 -04:00
turnstile
typesniffer
updatechecker
upload
uri
user
util Add Debian package registry (#24426) 2023-05-02 12:31:35 -04:00
validation
web Improve template system and panic recovery (#24461) 2023-05-04 14:36:34 +08:00
webhook