Use grants clone (#716)

This commit is contained in:
Raja Subramanian
2022-05-25 15:29:23 +05:30
committed by GitHub
parent 08f047c157
commit 73db950ea4
3 changed files with 4 additions and 6 deletions
+1 -3
View File
@@ -347,7 +347,7 @@ func (p *ParticipantImpl) ClaimGrants() *auth.ClaimGrants {
p.lock.RLock()
defer p.lock.RUnlock()
return p.grants
return p.grants.Clone()
}
func (p *ParticipantImpl) SetPermission(permission *livekit.ParticipantPermission) bool {
@@ -374,8 +374,6 @@ func (p *ParticipantImpl) SetPermission(permission *livekit.ParticipantPermissio
video.Recorder = permission.Recorder
canPublish := video.GetCanPublish()
p.grants.Video = video
p.lock.Unlock()
// publish permission has been revoked then remove all published tracks