77using  JoinRpg . Helpers ; 
88using  JoinRpg . Interfaces ; 
99using  JoinRpg . PrimitiveTypes ; 
10+ using  JoinRpg . PrimitiveTypes . Access ; 
1011using  JoinRpg . PrimitiveTypes . ProjectMetadata ; 
1112using  JoinRpg . Services . Interfaces . Characters ; 
1213using  JoinRpg . Services . Interfaces . Notification ; 
@@ -86,7 +87,7 @@ public async Task EditCharacter(EditCharacterRequest editCharacterRequest)
8687    { 
8788        var  character  =  await  LoadCharacter ( editCharacterRequest . Id ) ; 
8889
89-         var  projectInfo  =  await  projectMetadataRepository . GetProjectMetadata ( new ( editCharacterRequest . Id . ProjectId ) ) ; 
90+         var  projectInfo  =  await  projectMetadataRepository . GetProjectMetadata ( editCharacterRequest . Id . ProjectId ) ; 
9091
9192        SetCharacterSettings ( character ,  editCharacterRequest . CharacterTypeInfo ,  projectInfo ) ; 
9293
@@ -145,7 +146,7 @@ private async Task<Character> LoadCharacter(CharacterIdentification moniker)
145146    { 
146147        var  character  =  await  CharactersRepository . GetCharacterAsync ( moniker . ProjectId ,  moniker . CharacterId ) ; 
147148
148-         return  character . RequestMasterAccess ( CurrentUserId ,  acl  =>   acl . CanEditRoles ) . EnsureProjectActive ( ) ; 
149+         return  character . RequestMasterAccess ( CurrentUserId ,  Permission . CanEditRoles ) . EnsureProjectActive ( ) ; 
149150    } 
150151
151152    public  async  Task  MoveCharacter ( int  currentUserId , 
@@ -166,13 +167,10 @@ public async Task MoveCharacter(int currentUserId,
166167        await  UnitOfWork . SaveChangesAsync ( ) ; 
167168    } 
168169
169-     public  async  Task  SetFields ( int   projectId ,   int  characterId ,  Dictionary < int ,  string ? >  requestFieldValues ) 
170+     public  async  Task  SetFields ( CharacterIdentification  characterId ,  Dictionary < int ,  string ? >  requestFieldValues ) 
170171    { 
171-         var  character  =  await  LoadProjectSubEntityAsync < Character > ( projectId ,  characterId ) ; 
172-         var  projectInfo  =  await  projectMetadataRepository . GetProjectMetadata ( new ( projectId ) ) ; 
173-         _  =  character . RequestMasterAccess ( CurrentUserId ,  acl =>  acl . CanEditRoles ) ; 
174- 
175-         _  =  character . EnsureProjectActive ( ) ; 
172+         var  character  =  await  LoadCharacter ( characterId ) ; 
173+         var  projectInfo  =  await  projectMetadataRepository . GetProjectMetadata ( characterId . ProjectId ) ; 
176174
177175        var  changedFields  =  fieldSaveHelper . SaveCharacterFields ( CurrentUserId , 
178176            character , 
@@ -183,7 +181,7 @@ public async Task SetFields(int projectId, int characterId, Dictionary<int, stri
183181
184182        FieldsChangedEmail ?  email  =  null ; 
185183
186-         if  ( changedFields . Any ( ) ) 
184+         if  ( changedFields . Count   !=   0 ) 
187185        { 
188186            var  user  =  await  UserRepository . GetById ( CurrentUserId ) ; 
189187            email  =  EmailHelpers . CreateFieldsEmail ( 
0 commit comments