mirror of
1
Fork 0
forgejo/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>
2023-05-05 15:07:02 +02:00
..
actions.go
admin.go
api.go
attachment.go Add `.patch` to `attachment.ALLOWED_TYPES` (#23580) (#23582) 2023-03-19 16:48:44 -04:00
cache.go
camo.go
config_provider.go
cors.go Fix incorrect CORS default values (#24206) (#24217) 2023-04-19 16:23:25 -04:00
cron.go
cron_test.go
database.go
database_sqlite.go
database_test.go
federation.go
git.go Support reflogs (#22451) (#23438) 2023-03-13 12:20:10 +00:00
highlight.go
i18n.go
incoming_email.go
indexer.go
indexer_test.go
lfs.go
log.go
mailer.go
mailer_test.go
markup.go
metrics.go
migrations.go
mime_type_map.go
mirror.go
oauth2.go
other.go
packages.go
packages_test.go
picture.go
project.go
proxy.go
queue.go
repository.go Fix the permission of team's `Actions` unit issue (#24536) (#24545) 2023-05-05 15:07:02 +02:00
security.go
server.go
service.go
session.go
setting.go Fix incorrect CurrentUser check for docker rootless (#24435) 2023-04-29 23:47:04 -04:00
setting_test.go
ssh.go
storage.go Make minio package support legacy MD5 checksum (#23768) (#23770) 2023-03-29 00:02:13 +08:00
storage_test.go
task.go
time.go
ui.go Don't set meta `theme-color` by default (#24340) (#24346) 2023-04-26 01:33:15 -04:00
webhook.go