Skip to content

Commit

Permalink
Add support for disabling publish permission when adding participants (
Browse files Browse the repository at this point in the history
  • Loading branch information
mjh1 authored Jun 30, 2023
1 parent 205d37c commit 55913d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/api/src/controllers/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ app.post(
ttl: 5 * 60,
}
);
at.addGrant({ roomJoin: true, room: req.params.roomId });
at.addGrant({
roomJoin: true,
room: req.params.roomId,
canPublish: req.body.canPublish ?? true,
});
const token = at.toJwt();

res.status(201);
Expand Down
3 changes: 3 additions & 0 deletions packages/api/src/schema/api-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,9 @@ components:
properties:
name:
type: string
canPublish:
type: boolean
description: Whether a user is allowed to publish audio/video tracks
room-egress-payload:
type: object
required:
Expand Down

0 comments on commit 55913d0

Please sign in to comment.