mirror of
https://github.com/eyebluecn/tank.git
synced 2024-04-21 12:32:16 +00:00
fix: fix the auth bug.
This commit is contained in:
@@ -65,6 +65,9 @@ func (this *SpaceMemberService) canManage(user *User, spaceUuid string) bool {
|
||||
if user.Role == USER_ROLE_ADMINISTRATOR {
|
||||
return true
|
||||
}
|
||||
if user.SpaceUuid == spaceUuid {
|
||||
return true
|
||||
}
|
||||
|
||||
//only space's admin can add member.
|
||||
spaceMember := this.spaceMemberDao.FindBySpaceUuidAndUserUuid(spaceUuid, user.Uuid)
|
||||
@@ -76,6 +79,9 @@ func (this *SpaceMemberService) canRead(user *User, spaceUuid string) bool {
|
||||
if user.Role == USER_ROLE_ADMINISTRATOR {
|
||||
return true
|
||||
}
|
||||
if user.SpaceUuid == spaceUuid {
|
||||
return true
|
||||
}
|
||||
|
||||
//only space's admin can add member.
|
||||
spaceMember := this.spaceMemberDao.FindBySpaceUuidAndUserUuid(spaceUuid, user.Uuid)
|
||||
@@ -87,6 +93,9 @@ func (this *SpaceMemberService) canWrite(user *User, spaceUuid string) bool {
|
||||
if user.Role == USER_ROLE_ADMINISTRATOR {
|
||||
return true
|
||||
}
|
||||
if user.SpaceUuid == spaceUuid {
|
||||
return true
|
||||
}
|
||||
|
||||
//only space's admin can add member.
|
||||
spaceMember := this.spaceMemberDao.FindBySpaceUuidAndUserUuid(spaceUuid, user.Uuid)
|
||||
|
||||
Reference in New Issue
Block a user