mirror of
https://github.com/harness/drone.git
synced 2025-05-10 07:42:12 +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,
|
principalID int64,
|
||||||
in githook.PostReceiveInput,
|
in githook.PostReceiveInput,
|
||||||
) (*githook.Output, error) {
|
) (*githook.Output, error) {
|
||||||
repo, err := c.getRepoCheckAccess(ctx, session, repoID, enum.PermissionRepoEdit)
|
repo, err := c.getRepoCheckAccess(ctx, session, repoID, enum.PermissionRepoPush)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ func (c *Controller) PreReceive(
|
|||||||
) (*githook.Output, error) {
|
) (*githook.Output, error) {
|
||||||
output := &githook.Output{}
|
output := &githook.Output{}
|
||||||
|
|
||||||
repo, err := c.getRepoCheckAccess(ctx, session, repoID, enum.PermissionRepoEdit)
|
repo, err := c.getRepoCheckAccess(ctx, session, repoID, enum.PermissionRepoPush)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ func (c *Controller) Merge(
|
|||||||
}
|
}
|
||||||
in.Method = method
|
in.Method = method
|
||||||
|
|
||||||
targetRepo, err := c.getRepoCheckAccess(ctx, session, repoRef, enum.PermissionRepoEdit)
|
targetRepo, err := c.getRepoCheckAccess(ctx, session, repoRef, enum.PermissionRepoPush)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, fmt.Errorf("failed to acquire access to target repo: %w", err)
|
return nil, nil, fmt.Errorf("failed to acquire access to target repo: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user