@@ -34,17 +34,23 @@ public ContentPermissionStorage(IContentStorage storage, IDragonFlyApi api, IPri
34
34
35
35
public async Task < Result > CreateAsync ( ContentItem content )
36
36
{
37
- return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( content . Schema . Name , ContentAction . Create ) ) . ThenAsync ( x => Storage . CreateAsync ( content ) ) ;
37
+ return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( content . Schema . Name , ContentAction . Create ) )
38
+ . ThenAsync ( x => Storage . CreateAsync ( content ) )
39
+ . ConfigureAwait ( false ) ;
38
40
}
39
41
40
42
public async Task < Result < bool > > DeleteAsync ( string schema , Guid id )
41
43
{
42
- return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( schema , ContentAction . Delete ) ) . ThenAsync ( x => Storage . DeleteAsync ( schema , id ) ) ;
44
+ return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( schema , ContentAction . Delete ) )
45
+ . ThenAsync ( x => Storage . DeleteAsync ( schema , id ) )
46
+ . ConfigureAwait ( false ) ;
43
47
}
44
48
45
49
public async Task < Result < ContentItem ? > > GetContentAsync ( string schema , Guid id )
46
50
{
47
- return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( schema , ContentAction . Read ) ) . ThenAsync ( x => Storage . GetContentAsync ( schema , id ) ) ;
51
+ return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( schema , ContentAction . Read ) )
52
+ . ThenAsync ( x => Storage . GetContentAsync ( schema , id ) )
53
+ . ConfigureAwait ( false ) ;
48
54
}
49
55
50
56
public async Task < Result < ContentReferenceIndex > > GetReferencedByAsync ( string schema , Guid id )
@@ -56,36 +62,48 @@ public async Task<Result<ContentReferenceIndex>> GetReferencedByAsync(string sch
56
62
57
63
public async Task < Result < bool > > PublishAsync ( string schema , Guid id )
58
64
{
59
- return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( schema , ContentAction . Publish ) ) . ThenAsync ( x => Storage . PublishAsync ( schema , id ) ) ;
65
+ return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( schema , ContentAction . Publish ) )
66
+ . ThenAsync ( x => Storage . PublishAsync ( schema , id ) )
67
+ . ConfigureAwait ( false ) ;
60
68
}
61
69
62
70
public async Task < Result < BackgroundTaskInfo > > PublishQueryAsync ( ContentQuery query )
63
71
{
64
- return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( query . Schema , ContentAction . Publish ) ) . ThenAsync ( x => Storage . PublishQueryAsync ( query ) ) ;
72
+ return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( query . Schema , ContentAction . Publish ) )
73
+ . ThenAsync ( x => Storage . PublishQueryAsync ( query ) )
74
+ . ConfigureAwait ( false ) ;
65
75
}
66
76
67
77
public async Task < Result < QueryResult < ContentItem > > > QueryAsync ( ContentQuery query )
68
78
{
69
- return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( query . Schema , ContentAction . Query ) ) . ThenAsync ( x => Storage . QueryAsync ( query ) ) ;
79
+ return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( query . Schema , ContentAction . Query ) )
80
+ . ThenAsync ( x => Storage . QueryAsync ( query ) )
81
+ . ConfigureAwait ( false ) ;
70
82
}
71
83
72
84
public async Task < Result < bool > > UnpublishAsync ( string schema , Guid id )
73
85
{
74
- return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( schema , ContentAction . Unpublish ) ) . ThenAsync ( x => Storage . UnpublishAsync ( schema , id ) ) ;
86
+ return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( schema , ContentAction . Unpublish ) )
87
+ . ThenAsync ( x => Storage . UnpublishAsync ( schema , id ) )
88
+ . ConfigureAwait ( false ) ;
75
89
}
76
90
77
91
public async Task < Result < BackgroundTaskInfo > > UnpublishQueryAsync ( ContentQuery query )
78
92
{
79
- return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( query . Schema , ContentAction . Unpublish ) ) . ThenAsync ( x => Storage . UnpublishQueryAsync ( query ) ) ;
93
+ return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( query . Schema , ContentAction . Unpublish ) )
94
+ . ThenAsync ( x => Storage . UnpublishQueryAsync ( query ) )
95
+ . ConfigureAwait ( false ) ;
80
96
}
81
97
82
98
public async Task < Result > UpdateAsync ( ContentItem content )
83
99
{
84
- return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( content . Schema . Name , ContentAction . Update ) ) . ThenAsync ( x => Storage . UpdateAsync ( content ) ) ;
100
+ return await Api . AuthorizeAsync ( PrincipalContext . Current , ContentPermissions . Create ( content . Schema . Name , ContentAction . Update ) )
101
+ . ThenAsync ( x => Storage . UpdateAsync ( content ) )
102
+ . ConfigureAwait ( false ) ;
85
103
}
86
104
87
105
public async Task < Result > RebuildDatabaseAsync ( )
88
106
{
89
- return await Storage . RebuildDatabaseAsync ( ) ;
107
+ return await Storage . RebuildDatabaseAsync ( ) . ConfigureAwait ( false ) ;
90
108
}
91
109
}
0 commit comments