mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
Merge pull request #743 from Hinton/feature/hide-passwords
Add support collection access, hide passwords
This commit is contained in:
@ -11,13 +11,15 @@ namespace Bit.Core.Models.Api
|
||||
[Required]
|
||||
public string Id { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool HidePasswords { get; set; }
|
||||
|
||||
public SelectionReadOnly ToSelectionReadOnly()
|
||||
{
|
||||
return new SelectionReadOnly
|
||||
{
|
||||
Id = new Guid(Id),
|
||||
ReadOnly = ReadOnly
|
||||
ReadOnly = ReadOnly,
|
||||
HidePasswords = HidePasswords,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -89,11 +89,13 @@ namespace Bit.Core.Models.Api
|
||||
FolderId = cipher.FolderId?.ToString();
|
||||
Favorite = cipher.Favorite;
|
||||
Edit = cipher.Edit;
|
||||
ViewPassword = cipher.ViewPassword;
|
||||
}
|
||||
|
||||
public string FolderId { get; set; }
|
||||
public bool Favorite { get; set; }
|
||||
public bool Edit { get; set; }
|
||||
public bool ViewPassword { get; set; }
|
||||
}
|
||||
|
||||
public class CipherDetailsResponseModel : CipherResponseModel
|
||||
|
@ -34,9 +34,11 @@ namespace Bit.Core.Models.Api
|
||||
: base(collectionDetails, "collectionDetails")
|
||||
{
|
||||
ReadOnly = collectionDetails.ReadOnly;
|
||||
HidePasswords = collectionDetails.HidePasswords;
|
||||
}
|
||||
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool HidePasswords { get; set; }
|
||||
}
|
||||
|
||||
public class CollectionGroupDetailsResponseModel : CollectionResponseModel
|
||||
|
@ -14,9 +14,11 @@ namespace Bit.Core.Models.Api
|
||||
|
||||
Id = selection.Id.ToString();
|
||||
ReadOnly = selection.ReadOnly;
|
||||
HidePasswords = selection.HidePasswords;
|
||||
}
|
||||
|
||||
public string Id { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool HidePasswords { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -7,5 +7,6 @@ namespace Core.Models.Data
|
||||
public Guid? FolderId { get; set; }
|
||||
public bool Favorite { get; set; }
|
||||
public bool Edit { get; set; }
|
||||
public bool ViewPassword { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -5,5 +5,6 @@ namespace Bit.Core.Models.Data
|
||||
public class CollectionDetails : Collection
|
||||
{
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool HidePasswords { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -6,5 +6,6 @@ namespace Bit.Core.Models.Data
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
public bool HidePasswords { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -125,6 +125,8 @@ namespace Bit.Core.Utilities
|
||||
table.Columns.Add(idColumn);
|
||||
var readOnlyColumn = new DataColumn("ReadOnly", typeof(bool));
|
||||
table.Columns.Add(readOnlyColumn);
|
||||
var hidePasswordsColumn = new DataColumn("HidePasswords", typeof(bool));
|
||||
table.Columns.Add(hidePasswordsColumn);
|
||||
|
||||
if (values != null)
|
||||
{
|
||||
@ -133,6 +135,7 @@ namespace Bit.Core.Utilities
|
||||
var row = table.NewRow();
|
||||
row[idColumn] = value.Id;
|
||||
row[readOnlyColumn] = value.ReadOnly;
|
||||
row[hidePasswordsColumn] = value.HidePasswords;
|
||||
table.Rows.Add(row);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user