File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change 1
1
import { TalawaGraphQLError } from "./TalawaGraphQLError" ;
2
2
3
3
interface HasRole {
4
- role ?: string | null ;
4
+ role ?: string | null ;
5
5
}
6
6
7
7
export const assertOrganizationAdmin = (
8
- currentUser : HasRole | undefined ,
9
- membership : HasRole | undefined ,
10
- errorMessage : string ,
8
+ currentUser : HasRole | undefined ,
9
+ membership : HasRole | undefined ,
10
+ errorMessage : string ,
11
11
) : void => {
12
- if (
13
- currentUser ?. role !== "administrator" &&
14
- membership ?. role !== "administrator"
15
- ) {
16
- throw new TalawaGraphQLError ( {
17
- extensions : {
18
- code : "unauthorized_action" ,
19
- message : errorMessage ,
20
- } ,
21
- } ) ;
22
- }
12
+ if (
13
+ currentUser ?. role !== "administrator" &&
14
+ membership ?. role !== "administrator"
15
+ ) {
16
+ throw new TalawaGraphQLError ( {
17
+ extensions : {
18
+ code : "unauthorized_action" ,
19
+ message : errorMessage ,
20
+ } ,
21
+ } ) ;
22
+ }
23
23
} ;
You can’t perform that action at this time.
0 commit comments