Use grants clone (#716)

This commit is contained in:
Raja Subramanian authored and GitHub committed 2022-05-25 15:29:23 +05:30
1 parent 08f047c157
commit 73db950ea4
3 files changed
+4 -6

No files matched your search

+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