mirror of
https://github.com/harness/drone.git
synced 2025-05-10 03:09:55 +08:00
require push permission for PR merge (#725)
This commit is contained in:
parent
8d8535aa77
commit
059e9760c8
@ -44,7 +44,7 @@ func (c *Controller) PostReceive(
|
||||
principalID int64,
|
||||
in githook.PostReceiveInput,
|
||||
) (*githook.Output, error) {
|
||||
repo, err := c.getRepoCheckAccess(ctx, session, repoID, enum.PermissionRepoEdit)
|
||||
repo, err := c.getRepoCheckAccess(ctx, session, repoID, enum.PermissionRepoPush)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ func (c *Controller) PreReceive(
|
||||
) (*githook.Output, error) {
|
||||
output := &githook.Output{}
|
||||
|
||||
repo, err := c.getRepoCheckAccess(ctx, session, repoID, enum.PermissionRepoEdit)
|
||||
repo, err := c.getRepoCheckAccess(ctx, session, repoID, enum.PermissionRepoPush)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ func (c *Controller) Merge(
|
||||
}
|
||||
in.Method = method
|
||||
|
||||
targetRepo, err := c.getRepoCheckAccess(ctx, session, repoRef, enum.PermissionRepoEdit)
|
||||
targetRepo, err := c.getRepoCheckAccess(ctx, session, repoRef, enum.PermissionRepoPush)
|
||||
if err != nil {
|
||||
return nil, nil, fmt.Errorf("failed to acquire access to target repo: %w", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user