refactor: 💡 enable permission for listing session recordings (#215)
✅ Closes: ICU-9003
This commit is contained in:
1 parent
2de336186c
commit
87aea507f8
1 file changed
+22
-18
@@ -28,28 +28,32 @@ export default class ScopesScopeSessionRecordingsRoute extends Route {
|
||||
const scope = this.modelFor('scopes.scope');
|
||||
const { id: scope_id } = scope;
|
||||
|
||||
// if (this.can.can('list session-recording', scope, { collection: 'session-recordings' })) {
|
||||
const sessionRecordings = await this.store.query('session-recording', {
|
||||
scope_id,
|
||||
recursive: true,
|
||||
});
|
||||
|
||||
// Storage buckets could fail for a number of reasons, including that
|
||||
// the user isn't authorized to access them.
|
||||
try {
|
||||
storageBuckets = await this.store.query('storage-bucket', {
|
||||
if (
|
||||
this.can.can('list session-recording', scope, {
|
||||
collection: 'session-recordings',
|
||||
})
|
||||
) {
|
||||
const sessionRecordings = await this.store.query('session-recording', {
|
||||
scope_id,
|
||||
recursive: true,
|
||||
});
|
||||
} catch (e) {
|
||||
// no op
|
||||
}
|
||||
|
||||
return {
|
||||
sessionRecordings,
|
||||
storageBuckets,
|
||||
};
|
||||
// }
|
||||
// Storage buckets could fail for a number of reasons, including that
|
||||
// the user isn't authorized to access them.
|
||||
try {
|
||||
storageBuckets = await this.store.query('storage-bucket', {
|
||||
scope_id,
|
||||
recursive: true,
|
||||
});
|
||||
} catch (e) {
|
||||
// no op
|
||||
}
|
||||
|
||||
return {
|
||||
sessionRecordings,
|
||||
storageBuckets,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// =actions
|
||||
|
||||
Reference in new issue
Block a user