streamby-core 0.10.8 → 0.10.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,7 +129,16 @@ function createStreamByRouter(config) {
129
129
  });
130
130
  router.patch('/projects/:id', async (req, res) => {
131
131
  try {
132
- const updated = await (0, project_1.updateProjectService)(req, config.authProvider, config.projectProvider);
132
+ const auth = await config.authProvider(req);
133
+ if (auth.role !== 'admin' && auth.role !== 'editor') {
134
+ return res.status(403).json({ error: 'Permission denied' });
135
+ }
136
+ const projectId = req.params.id;
137
+ const updates = req.body;
138
+ if (!updates || typeof updates !== 'object') {
139
+ return res.status(400).json({ error: 'Missing updates payload' });
140
+ }
141
+ const updated = await config.projectProvider.update(projectId, updates);
133
142
  res.status(200).json({ success: true, project: updated });
134
143
  }
135
144
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "streamby-core",
3
- "version": "0.10.8",
3
+ "version": "0.10.9",
4
4
  "description": "StreamBy middleware framework for media storage management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",