mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Show private repository activities in dashboard if has access
This commit is contained in:
@@ -60,6 +60,9 @@ func UpdateAccessWithSession(sess *xorm.Session, access *Access) error {
|
||||
// HasAccess returns true if someone can read or write to given repository.
|
||||
// The repoName should be in format <username>/<reponame>.
|
||||
func HasAccess(uname, repoName string, mode int) (bool, error) {
|
||||
if len(repoName) == 0 {
|
||||
return false, nil
|
||||
}
|
||||
access := &Access{
|
||||
UserName: strings.ToLower(uname),
|
||||
RepoName: strings.ToLower(repoName),
|
||||
|
@@ -198,8 +198,8 @@ func TransferRepoAction(user, newUser *User, repo *Repository) (err error) {
|
||||
}
|
||||
|
||||
// GetFeeds returns action list of given user in given context.
|
||||
func GetFeeds(userid, offset int64, isProfile bool) ([]Action, error) {
|
||||
actions := make([]Action, 0, 20)
|
||||
func GetFeeds(userid, offset int64, isProfile bool) ([]*Action, error) {
|
||||
actions := make([]*Action, 0, 20)
|
||||
sess := orm.Limit(20, int(offset)).Desc("id").Where("user_id=?", userid)
|
||||
if isProfile {
|
||||
sess.Where("is_private=?", false).And("act_user_id=?", userid)
|
||||
|
Reference in New Issue
Block a user