refactor name
continuous-integration/drone/push Build was killed
Details
continuous-integration/drone/push Build was killed
Details
This commit is contained in:
parent
43f73c692d
commit
ee3d8b4aec
|
@ -28,7 +28,7 @@ func (l *List) CanWrite(a web.Auth) bool {
|
|||
|
||||
// Check all the things
|
||||
// Check if the user is either owner or can write to the list
|
||||
return l.isOwner(user) || l.checkListRight(user, ListRightWrite, ListRightAdmin)
|
||||
return l.isOwner(user) || l.checkRight(user, ListRightWrite, ListRightAdmin)
|
||||
}
|
||||
|
||||
// CanRead checks if a user has read access to a list
|
||||
|
@ -37,7 +37,7 @@ func (l *List) CanRead(a web.Auth) bool {
|
|||
|
||||
// Check all the things
|
||||
// Check if the user is either owner or can read
|
||||
return l.isOwner(user) || l.checkListRight(user, ListRightRead, ListRightWrite, ListRightAdmin)
|
||||
return l.isOwner(user) || l.checkRight(user, ListRightRead, ListRightWrite, ListRightAdmin)
|
||||
}
|
||||
|
||||
// CanDelete checks if the user can delete a list
|
||||
|
@ -65,7 +65,7 @@ func (l *List) IsAdmin(a web.Auth) bool {
|
|||
// Check all the things
|
||||
// Check if the user is either owner or can write to the list
|
||||
// Owners are always admins
|
||||
return l.isOwner(user) || l.checkListRight(user, ListRightAdmin)
|
||||
return l.isOwner(user) || l.checkRight(user, ListRightAdmin)
|
||||
}
|
||||
|
||||
// Little helper function to check if a user is list owner
|
||||
|
@ -77,7 +77,7 @@ func (l *List) isOwner(u *User) bool {
|
|||
}
|
||||
|
||||
// Checks n different rights for any given user
|
||||
func (l *List) checkListRight(user *User, rights ...ListRight) bool {
|
||||
func (l *List) checkRight(user *User, rights ...ListRight) bool {
|
||||
|
||||
/*
|
||||
The following loop creates an sql condition like this one:
|
||||
|
|
Loading…
Reference in New Issue