aboutsummaryrefslogtreecommitdiff
path: root/internal/db/repo_collaboration.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/repo_collaboration.go')
-rw-r--r--internal/db/repo_collaboration.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/db/repo_collaboration.go b/internal/db/repo_collaboration.go
index b3d046ec..8aec18dc 100644
--- a/internal/db/repo_collaboration.go
+++ b/internal/db/repo_collaboration.go
@@ -22,11 +22,11 @@ type Collaboration struct {
func (c *Collaboration) ModeI18nKey() string {
switch c.Mode {
- case ACCESS_MODE_READ:
+ case AccessModeRead:
return "repo.settings.collaboration.read"
- case ACCESS_MODE_WRITE:
+ case AccessModeWrite:
return "repo.settings.collaboration.write"
- case ACCESS_MODE_ADMIN:
+ case AccessModeAdmin:
return "repo.settings.collaboration.admin"
default:
return "repo.settings.collaboration.undefined"
@@ -64,7 +64,7 @@ func (repo *Repository) AddCollaborator(u *User) error {
} else if has {
return nil
}
- collaboration.Mode = ACCESS_MODE_WRITE
+ collaboration.Mode = AccessModeWrite
sess := x.NewSession()
defer sess.Close()
@@ -96,9 +96,9 @@ func (c *Collaborator) APIFormat() *api.Collaborator {
return &api.Collaborator{
User: c.User.APIFormat(),
Permissions: api.Permission{
- Admin: c.Collaboration.Mode >= ACCESS_MODE_ADMIN,
- Push: c.Collaboration.Mode >= ACCESS_MODE_WRITE,
- Pull: c.Collaboration.Mode >= ACCESS_MODE_READ,
+ Admin: c.Collaboration.Mode >= AccessModeAdmin,
+ Push: c.Collaboration.Mode >= AccessModeWrite,
+ Pull: c.Collaboration.Mode >= AccessModeRead,
},
}
}
@@ -131,7 +131,7 @@ func (repo *Repository) GetCollaborators() ([]*Collaborator, error) {
// ChangeCollaborationAccessMode sets new access mode for the collaboration.
func (repo *Repository) ChangeCollaborationAccessMode(userID int64, mode AccessMode) error {
// Discard invalid input
- if mode <= ACCESS_MODE_NONE || mode > ACCESS_MODE_OWNER {
+ if mode <= AccessModeNone || mode > AccessModeOwner {
return nil
}