Hide actions if the user can't use them #977

Open
qwerty287 wants to merge 26 commits from qwerty287/GitNex:permissions-actions into main

closes #919

TODO

  • repo and file actions (create release, label...)
    • allow for repo admins
  • label actions (edit, delete)
    • allow for repo admins
  • issue/pr action that are available for creators (close...)
    • allow for creator
    • allow for repo admins
  • pr actions that are allowed when having push access to pr source (there is a bug in Gitea that makes that this is currently not working and these features are not accessible -> https://github.com/go-gitea/gitea/issues/17181)
    • allow deleting of head branch/updates only if you can do this
  • issue/pr action that are available for repo admins (merge)
    • allow for repo admins
  • milestone actions (close/reopen)
    • allow for repo admins
  • comment actions (delete, edit...)
    • allow for creators
    • allow for repo admins
  • org actions (create label, team, repo; req gitea 1.16.0)
  • actions when creating/editing issues
  • delete head when merging
  • All actions available to instance admins? (handled through API)

Maybe as extras:

  • Allow close/reopen also for PRs
  • Improve handling of these (multiple btns for the same action)
closes #919 TODO - [X] repo and file actions (create release, label...) - [X] allow for repo admins - [x] label actions (edit, delete) - [x] allow for repo admins - [X] issue/pr action that are available for creators (close...) - [X] allow for creator - [X] allow for repo admins - [x] pr actions that are allowed when having push access to pr source (there is a bug in Gitea that makes that this is currently not working and these features are not accessible -> https://github.com/go-gitea/gitea/issues/17181) - [x] allow deleting of head branch/updates only if you can do this - [x] issue/pr action that are available for repo admins (merge) - [x] allow for repo admins - [x] milestone actions (close/reopen) - [x] allow for repo admins - [x] comment actions (delete, edit...) - [X] allow for creators - [x] allow for repo admins - [x] org actions (create label, team, repo; req gitea 1.16.0) - [x] actions when creating/editing issues - [x] delete head when merging - [x] All actions available to instance admins? (handled through API) Maybe as extras: - [x] Allow close/reopen also for PRs - [x] Improve handling of these (multiple btns for the same action)
qwerty287 added 1 commit 1 month ago
qwerty287 added 1 commit 1 month ago
qwerty287 added 2 commits 1 month ago
qwerty287 added 1 commit 1 month ago
qwerty287 added 4 commits 1 month ago
qwerty287 added 1 commit 4 weeks ago
qwerty287 added 1 commit 4 weeks ago
qwerty287 added 1 commit 4 weeks ago
qwerty287 added 1 commit 4 weeks ago
qwerty287 added 1 commit 4 weeks ago
qwerty287 added 1 commit 4 weeks ago
Poster

I think it's ready - the only point on my todo list is currently not solvable, you would have to get all teams and compare them (I created an issue on github https://github.com/go-gitea/gitea/issues/17173) - so let's move this to later.

I think it's ready - the only point on my todo list is currently not solvable, you would have to get all teams and compare them (I created an issue on github https://github.com/go-gitea/gitea/issues/17173) - so let's move this to later.
qwerty287 changed title from WIP: Hide actions if the user can't use them to Hide actions if the user can't use them 4 weeks ago
Owner

I would like to test this PR. But I need some pointers to start with, like for example putting the scenarios to test proplery would be great.

Example:

  • Can Admin use all features
  • What about collaborator?
  • What about team person?

etc etc

I would like to test this PR. But I need some pointers to start with, like for example putting the scenarios to test proplery would be great. Example: - Can Admin use all features - What about collaborator? - What about team person? etc etc
Poster

I think everything is handled through the api:

  • instance admins can do everything everywhere
  • teams and collaborators should work as well

(The api correctly changes the push value of the repo permissions if you are collaborator or in a specific team)

I think everything is handled through the api: * instance admins can do everything everywhere * teams and collaborators should work as well (The api correctly changes the `push` value of the repo permissions if you are collaborator or in a specific team)
Poster

pr actions that are allowed when having push access to pr source (there is a bug in Gitea that makes that this is currently not working and these features are not accessible -> https://github.com/go-gitea/gitea/issues/17181)

Please note this - maybe a version check is required here (the bug is marked for gitea 1.15.4)

> pr actions that are allowed when having push access to pr source (there is a bug in Gitea that makes that this is currently not working and these features are not accessible -> https://github.com/go-gitea/gitea/issues/17181) Please note this - maybe a version check is required here (the bug is marked for gitea 1.15.4)
qwerty287 added the
Enhancement
label 4 weeks ago
qwerty287 added 1 commit 3 weeks ago
qwerty287 added 1 commit 3 weeks ago
qwerty287 added 1 commit 3 weeks ago
mmarif added this to the 4.2.0 milestone 2 weeks ago
qwerty287 added 1 commit 2 weeks ago
qwerty287 changed title from Hide actions if the user can't use them to WIP: Hide actions if the user can't use them 2 weeks ago
Poster

Marked this as wip since org permissions were added to gitea - I'll implement this too in this pr

Marked this as wip since org permissions were added to gitea - I'll implement this too in this pr
qwerty287 added 1 commit 2 weeks ago
qwerty287 added 3 commits 2 weeks ago
qwerty287 added 1 commit 1 week ago
qwerty287 changed title from WIP: Hide actions if the user can't use them to Hide actions if the user can't use them 1 week ago
Poster

Finished it, also changed some error handlers to show adequate errors to the user

Finished it, also changed some error handlers to show adequate errors to the user
qwerty287 added 1 commit 1 week ago
qwerty287 added 1 commit 1 week ago
This Pull Request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.