Private Issues: Issue-level access control and DB queries #418
Labels
No labels
Backlog Status
Needs Review
Backlog Status
Ready
Chore
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#113 Private Issues
forge/forge
Reference
forge/forge#418
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Story
As a user of Forgejo,
I want to view and list public and private issues via the REST API,
so I can work with private issues using the web API.
Acceptance Criteria
Issue.CanAccess()method exists which determines if the current user is allowed to access an issue. For public issues (IsPrivate == false), this always returns true, for private issues it will check if the current user created the issue or owns the repository (directly or via organization) and return true in this case, otherwise false.A function (name and place TBD) exists toForgejo can query the DB for private issues, filtering them for the perspective of the current user (see above).Issues()andIssueIDs()(ofmodels/issues/issues_search.go) as well as their building blocks(and their users elsewhere)are updated so they can deal with both public and private issues.Background
Various
to be implementedfunctions will need know if a certain issue should be shown to the user. Some might need to decide this on a one by one basis (e.g. viewing one issue), some might need to query private issues and filter in bulk.Beware,
.OriginalAuthorIDmust be considered, seemodels/issues/issue.go:Private Issues: Issue-level access controlto Private Issues: Issue-level access control and DB queriesIssue.CanAccess()and corresponding tests are in my feature branch, in “Add Issue.CanAccess()”.In my feature branch, the functions
Issues()andIssueIDs()frommodels/issues/issue_search.gocan …IssuesOptions.IsPrivate. Implemented inMake Issues(), IssueIDs() cope with private issues.IssueOptions.DoerID) is allowed to see. Implemented inAllow filtering private issues in searches.