File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
backend/src/database/repositories Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,11 @@ class CustomViewRepository {
63
63
throw new Error404 ( )
64
64
}
65
65
66
+ // don't allow other users private custom views to be updated
67
+ if ( record . visibility === 'user' && record . createdById !== currentUser . id ) {
68
+ throw new Error ( 'Update not allowed as custom view was not created by user!' )
69
+ }
70
+
66
71
// we don't allow placement to be updated
67
72
record = await record . update (
68
73
{
@@ -112,6 +117,11 @@ class CustomViewRepository {
112
117
throw new Error404 ( )
113
118
}
114
119
120
+ // don't allow other users private custom views to be deleted
121
+ if ( record . visibility === 'user' && record . createdById !== currentUser . id ) {
122
+ throw new Error ( 'Deletion not allowed as custom view was not created by user!' )
123
+ }
124
+
115
125
// update who deleted the custom view
116
126
await record . update (
117
127
{
You can’t perform that action at this time.
0 commit comments