mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-05 01:44:36 -04:00
Show private repository activities in dashboard if has access
This commit is contained in:
parent
a742ee543e
commit
914ffa496f
6 changed files with 54 additions and 13 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue