Skip to content

Commit

Permalink
feat: Prevent from editing and restoring Profiles
Browse files Browse the repository at this point in the history
We want to remove the concept of `Profiles` as they overlap with Cozy's
`Contacts`

In cozy-keys-browser we will add the concept of `Contacts` to replace
old profiles, but in cozy-pass-mobile we won't add this for now as it
would require more work that we did not prioritize yet (we may want to
wait for future Bitwarden's announced technology switch)

This commit prevents from editing and restoring `Profile` ciphers

Related PR: cozy/cozy-keys-browser#169
  • Loading branch information
Ldoppea committed Mar 29, 2024
1 parent 02b3657 commit ee4def6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/App/Pages/Vault/ViewPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,15 @@ private void AdjustToolbar()
{
ToolbarItems.Insert(1, _editItem);
}
// Cozy customization, Prevent to restore/edit/clone/move Profiles as they will be replaced by Cozy Contacts
//*
if (_vm.Cipher.Type == Core.Enums.CipherType.Identity)
{
ToolbarItems.Remove(_editItem);
ToolbarItems.Remove(_cloneItem);
ToolbarItems.Remove(_shareItem);
}
//*/
}
}
}
2 changes: 1 addition & 1 deletion src/App/Pages/Vault/ViewPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public bool TotpLow
}
}
public bool IsDeleted => Cipher.IsDeleted;
public bool CanEdit => !Cipher.IsDeleted;
public bool CanEdit => !Cipher.IsDeleted && Cipher.Type != CipherType.Identity;

// Cozy customization, display folder (Cozy concept)
//*
Expand Down
6 changes: 6 additions & 0 deletions src/App/Utilities/AppHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ public static async Task<string> CipherListOptions(ContentPage page, CipherView
var clipboardService = ServiceContainer.Resolve<IClipboardService>("clipboardService");

var options = new List<string> { AppResources.View };

// Cozy customization, Prevent to edit Profiles as they will be replaced by Cozy Contacts
/*
if (!cipher.IsDeleted)
/*/
if (!cipher.IsDeleted && cipher.Type != CipherType.Identity)
//*/
{
options.Add(AppResources.Edit);
}
Expand Down

0 comments on commit ee4def6

Please sign in to comment.