From 0081c6911d7ea28eb617b56e32012ba4dc9af90b Mon Sep 17 00:00:00 2001 From: Pablo Saavedra Date: Thu, 2 Feb 2017 03:08:59 +0100 Subject: Check deploy keys when Gogs is run with Service.RequireSignInView=true (#4078) * Check deploy keys when Gogs is run with require_sign_in_view Check if the deploy key can access to a repository. A deploy key doesn't represent an gogs user, so in a site with Service.RequireSignInView activated we should give read access only in the repositories where this deploy key is in use. In other case, a deploy service or system using an active deploy key can get read access to all the repositories in a Gogs service. * Refactoring: Comments starts in a new line * Minor change in a comment * Code cleaning. Replace spaces with tabs --- modules/setting/setting.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/setting') diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 3b3aa69a..54a837e2 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -806,6 +806,10 @@ func newWebhookService() { Webhook.PagingNum = sec.Key("PAGING_NUM").MustInt(10) } +func NewService() { + newService() +} + func NewServices() { newService() newLogService() -- cgit v1.2.3