SendData API & publishData permission (#88)
* SendData Server API * SendData Server-API adjustments based on suggestions * Update proto version * enforce publishData permission * go mod tidy * fix go.mod * go mod tidy Co-authored-by: ChesterMing <89124853+ChesterMing@users.noreply.github.com>
This commit is contained in:
co-authored by
ChesterMing
parent
2ab37d8fcc
commit
bcf6e15e07
@@ -92,3 +92,21 @@ func handleError(w http.ResponseWriter, status int, msg string) {
|
||||
func boolValue(s string) bool {
|
||||
return s == "1" || s == "true"
|
||||
}
|
||||
|
||||
func permissionFromGrant(claim *auth.VideoGrant) *livekit.ParticipantPermission {
|
||||
p := &livekit.ParticipantPermission{
|
||||
CanSubscribe: true,
|
||||
CanPublish: true,
|
||||
CanPublishData: true,
|
||||
}
|
||||
if claim.CanPublish != nil {
|
||||
p.CanPublish = *claim.CanPublish
|
||||
}
|
||||
if claim.CanSubscribe != nil {
|
||||
p.CanSubscribe = *claim.CanSubscribe
|
||||
}
|
||||
if claim.CanPublishData != nil {
|
||||
p.CanPublishData = *claim.CanPublishData
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user