Skip to content

Commit 67cfbc2

Browse files
fix: added permission rules to interact with project data (#455)
* fix: added permission rules to interact with project data * Bump version up to 1.1.6 --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 4a7d7a6 commit 67cfbc2

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/resolvers/project.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ module.exports = {
2020
/**
2121
* Returns project's Model
2222
* @param {ResolverObj} _obj
23-
* @param {String} id - project id
23+
* @param {String} projectId - project id
2424
* @param {ContextFactories} factories - factories for working with models
2525
* @return {Promise<ProjectDBScheme>}
2626
*/
27-
async project(_obj, { id }, { factories }) {
28-
return factories.projectsFactory.findById(id);
27+
async project(_obj, { projectId }, { factories }) {
28+
return factories.projectsFactory.findById(projectId);
2929
},
3030
},
3131
Mutation: {

src/typeDefs/project.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ type Project {
9595
"""
9696
Project's Event
9797
"""
98-
event(id: ID!): Event @requireAuth
98+
event(id: ID!): Event
9999
100100
"""
101101
Project events
@@ -106,7 +106,7 @@ type Project {
106106
107107
"Certain number of documents to skip"
108108
skip: Int = 0
109-
): [Event!] @requireAuth
109+
): [Event!]
110110
111111
"""
112112
Returns recent events grouped by day
@@ -123,7 +123,7 @@ type Project {
123123
124124
"Event marks by which events should be sorted"
125125
filters: EventsFiltersInput
126-
): RecentEvents @requireAuth
126+
): RecentEvents
127127
"""
128128
Return events that occurred after a certain timestamp
129129
"""
@@ -137,23 +137,23 @@ type Project {
137137
User's local timezone offset in minutes
138138
"""
139139
timezoneOffset: Int! = 0
140-
): [ChartDataItem] @requireAuth
140+
): [ChartDataItem]
141141
"""
142142
Returns number of unread events
143143
"""
144-
unreadCount: Int! @requireAuth
144+
unreadCount: Int!
145145
146146
"""
147147
Project notification settings
148148
"""
149-
notifications: [ProjectNotificationsRule] @requireAuth
149+
notifications: [ProjectNotificationsRule]
150150
}
151151
152152
extend type Query {
153153
"""
154154
Returns project info
155155
"""
156-
project("Project id" id: ID!): Project @requireAuth
156+
project("Project id" projectId: ID!): Project @requireUserInWorkspace
157157
}
158158
159159
extend type Mutation {
@@ -199,7 +199,7 @@ extend type Mutation {
199199
Project image
200200
"""
201201
image: Upload @uploadImage
202-
): Project! @requireAuth
202+
): Project! @requireAdmin
203203
204204
"""
205205
Generates new project integration token by id
@@ -227,6 +227,6 @@ extend type Mutation {
227227
project ID
228228
"""
229229
projectId: ID!
230-
): DateTime! @requireAuth
230+
): DateTime! @requireUserInWorkspace
231231
}
232232
`;

0 commit comments

Comments
 (0)