forgejo/modules
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>
2023-05-05 15:07:02 +02:00
..
actions Fix mismatch between hook events and github event types (#24048) (#24091) 2023-04-13 15:19:41 +08:00
activitypub Add Chef package registry (#22554) 2023-02-06 09:49:21 +08:00
analyze
auth Fix various bugs for "install" page (#23194) (#23286) 2023-03-05 11:59:58 +01:00
avatar
base
cache Update redis library to support redis v7 (#24114) (#24156) 2023-04-17 02:34:59 -04:00
charset Fix isAllowed of escapeStreamer (#22814) 2023-02-09 20:51:36 +08:00
container
context Require repo scope for PATs for private repos and basic authentication (#24362) (#24364) 2023-04-26 20:57:51 -04:00
csv Add context when rendering labels or emojis (#23281) (#23319) 2023-03-06 10:32:40 -06:00
doctor Check LFS/Packages settings in dump and doctor command (#23631) (#23730) 2023-03-27 16:28:22 +08:00
emoji Fix unstable emoji sort (#22346) 2023-01-05 13:58:51 +02:00
eventsource
generate
git Remove Repository.getFilesChanged to fix Actions paths and paths-ignore filter (#23920) (#23969) 2023-04-08 16:16:21 +08:00
gitgraph Add context cache as a request level cache (#22294) 2023-02-15 21:37:34 +08:00
graceful
hcaptcha Consume hcaptcha and pwn deps (#22610) 2023-01-29 09:49:51 -06:00
highlight Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
hostmatcher
html
httpcache Set X-Gitea-Debug header once (#23361) (#23381) 2023-03-09 06:33:05 +08:00
httplib
indexer Refactor the setting to make unit test easier (#22405) 2023-02-20 00:12:01 +08:00
issue/template Allow issue templates to not render title (#22589) 2023-01-26 22:45:49 -06:00
json
label Make label templates have consistent behavior and priority (#23749) (#24071) 2023-04-12 16:05:10 +02:00
lfs Make minio package support legacy MD5 checksum (#23768) (#23770) 2023-03-29 00:02:13 +08:00
log Improve trace logging for pulls and processes (#22633) 2023-02-03 18:11:48 -05:00
markup Add context when rendering labels or emojis (#23281) (#23319) 2023-03-06 10:32:40 -06:00
mcaptcha
metrics include build info in Prometheus metrics (#22819) 2023-02-08 19:54:01 +02:00
migration Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
mirror
nosql Update redis library to support redis v7 (#24114) (#24156) 2023-04-17 02:34:59 -04:00
notification Implement actions (#21937) 2023-01-31 09:45:19 +08:00
options Introduce path Clean/Join helper functions, partially backport&refactor (#23495) (#23607) 2023-03-22 19:56:20 +08:00
packages Use import of OCI structs (#22765) 2023-02-06 10:07:09 +00:00
paginator
pprof
private Implement actions (#21937) 2023-01-31 09:45:19 +08:00
process Improve trace logging for pulls and processes (#22633) 2023-02-03 18:11:48 -05:00
proxy Use proxy for pull mirror (#22771) 2023-02-11 08:39:50 +08:00
proxyprotocol
public
queue Skip known flaky queue tests on CI environment (#24443) 2023-04-30 15:25:42 -04:00
recaptcha
references Use correct captured group range when parsing cross-reference (#22672) 2023-01-31 10:08:05 +01:00
regexplru
repository Make label templates have consistent behavior and priority (#23749) (#24071) 2023-04-12 16:05:10 +02:00
secret
session Update redis library to support redis v7 (#24114) (#24156) 2023-04-17 02:34:59 -04:00
setting Fix the permission of team's Actions unit issue (#24536) (#24545) 2023-05-05 15:07:02 +02:00
sitemap
ssh
storage Make minio package support legacy MD5 checksum (#23768) (#23770) 2023-03-29 00:02:13 +08:00
structs Fix Org edit page bugs: renaming detection, maxlength (#24161) (#24171) 2023-04-17 12:20:47 -04:00
svg
sync
system
templates Fix custom mailer template on Windows (#24081) 2023-04-12 12:16:40 -04:00
test Rename repo.GetOwner to repo.LoadOwner (#22967) 2023-02-18 20:11:03 +08:00
timeutil Make time tooltips interactive (#23526) (#23527) 2023-03-16 16:23:11 -05:00
translation
turnstile Add new captcha: cloudflare turnstile (#22369) 2023-02-05 15:29:03 +08:00
typesniffer Do not recognize text files as audio (#23355) (#23368) 2023-03-08 16:03:05 +08:00
updatechecker
upload
uri
user
util Fix cases.Title crash for concurrency (#23885) (#23903) 2023-04-04 01:26:14 +02:00
validation Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
watcher
web Map OIDC groups to Orgs/Teams (#21441) 2023-02-08 14:44:42 +08:00
webhook