#2514 Add the "git/generateacls" API endpoint for projects
Merged by pingou. Opened by mprahl.
Unknown source master

Download 2514.patch

This endpoint is restricted to Pagure admins. @pingou can you double check that I did that right?

I think this is not quite right, but I'm not sure exactly how it should be done. @pingou can hopefully provide details.

Instead of checking is_admin you need to check that the token being used has the regenerate_gitolite "acl" associated with their session. No such acl currently exists, so it will have to be added.

Other acls that currently exist (and that you could grep for to see how it should work) are: create_project and modify_project.

@ralph the decorator @api_login_required(acls=['generate_acls_project']) on the function checks the ACLs. I am just also checking that the user is a Pagure site admin because @pingou only wanted admins to be able to do this so that Pagure doesn't get DDOS'd.

/me thinks

OK, I think we may need to remove the is_admin check otherwise @limb won't be able to trigger this check from the fedrepo-req-admin tool when processing new branches.

rebased

@ralph okay, I removed the admin check. Now anyone who has a token with the proper ACL can do this on a project.

I guess this is no longer used

Let's change the default list of what users are allowed to do to remove this ACL then

You can drop the two lines following by simply using or {} at the end of this line :)

One important comment, one not the rest looks good, thanks! :)

rebased

@pingou I addressed your comments. Please review when you can.

rebased

I'll add a commit to your branch adjusting the doc for this

rebased

1 new commit added

  • Adjust documentation about the change in USER_ACLS

rebased

Pull-Request has been merged by pingou

Metadata