mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
rework heatmap permissions (#14080)
* now uses the same permission model as for the activity feed: only include activities in repos, that the doer has access to. this might be somewhat slower. * also improves handling of user.KeepActivityPrivate (still shows the heatmap to self & admins) * extend tests * adjust integration test to new behaviour * add access to actions for admins * extend heatmap unit tests
This commit is contained in:
@@ -388,7 +388,7 @@ func TestPrivateActivityYesHeatmapHasNoContentForUserItself(t *testing.T) {
|
||||
session := loginUser(t, privateActivityTestUser)
|
||||
hasContent := testPrivateActivityHelperHasHeatmapContentFromSession(t, session)
|
||||
|
||||
assert.False(t, hasContent, "user should have no heatmap content")
|
||||
assert.True(t, hasContent, "user should see their own heatmap content")
|
||||
}
|
||||
|
||||
func TestPrivateActivityYesHeatmapHasNoContentForOtherUser(t *testing.T) {
|
||||
@@ -399,7 +399,7 @@ func TestPrivateActivityYesHeatmapHasNoContentForOtherUser(t *testing.T) {
|
||||
session := loginUser(t, privateActivityTestOtherUser)
|
||||
hasContent := testPrivateActivityHelperHasHeatmapContentFromSession(t, session)
|
||||
|
||||
assert.False(t, hasContent, "user should have no heatmap content")
|
||||
assert.False(t, hasContent, "other user should not see heatmap content")
|
||||
}
|
||||
|
||||
func TestPrivateActivityYesHeatmapHasNoContentForAdmin(t *testing.T) {
|
||||
@@ -410,5 +410,5 @@ func TestPrivateActivityYesHeatmapHasNoContentForAdmin(t *testing.T) {
|
||||
session := loginUser(t, privateActivityTestAdmin)
|
||||
hasContent := testPrivateActivityHelperHasHeatmapContentFromSession(t, session)
|
||||
|
||||
assert.False(t, hasContent, "user should have no heatmap content")
|
||||
assert.True(t, hasContent, "heatmap should show content for admin")
|
||||
}
|
||||
|
Reference in New Issue
Block a user