Skip to content

Commit

Permalink
Add agent to participant permission (#513)
Browse files Browse the repository at this point in the history
* add agent to participant permission

* generated protobuf

* agent values

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
frostbyte73 and github-actions[bot] authored Nov 7, 2023
1 parent 9020450 commit e230ee2
Show file tree
Hide file tree
Showing 3 changed files with 427 additions and 409 deletions.
5 changes: 5 additions & 0 deletions auth/grants.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ func (v *VideoGrant) MatchesPermission(permission *livekit.ParticipantPermission
if v.Recorder != permission.Recorder {
return false
}
if v.Agent != permission.Agent {
return false
}
if !slices.Equal(v.GetCanPublishSources(), permission.CanPublishSources) {
return false
}
Expand All @@ -198,6 +201,7 @@ func (v *VideoGrant) UpdateFromPermission(permission *livekit.ParticipantPermiss
v.SetCanUpdateOwnMetadata(permission.CanUpdateMetadata)
v.Hidden = permission.Hidden
v.Recorder = permission.Recorder
v.Agent = permission.Agent
}

func (v *VideoGrant) ToPermission() *livekit.ParticipantPermission {
Expand All @@ -209,6 +213,7 @@ func (v *VideoGrant) ToPermission() *livekit.ParticipantPermission {
CanUpdateMetadata: v.GetCanUpdateOwnMetadata(),
Hidden: v.Hidden,
Recorder: v.Recorder,
Agent: v.Agent,
}
return pp
}
Expand Down
Loading

0 comments on commit e230ee2

Please sign in to comment.