1
0
mirror of https://github.com/bitwarden/server synced 2025-12-30 07:03:42 +00:00

[SM-572] Modify project endpoint to return current user's permission (#2752)

* Add endpoints to check current user's permission

* Swap to adding current user permission onto GET

* Cleanup DI

* Add ProjectPermissionDetails DTO and query

* code review updates

* Remove assert recent for longer running creates
This commit is contained in:
Thomas Avery
2023-03-02 09:02:42 -06:00
committed by GitHub
parent 26c30f8854
commit 05f5d79938
9 changed files with 94 additions and 23 deletions

View File

@@ -0,0 +1,22 @@
using Bit.Core.SecretsManager.Entities;
namespace Bit.Api.SecretsManager.Models.Response;
public class ProjectPermissionDetailsResponseModel : ProjectResponseModel
{
private const string _objectName = "projectPermissionDetails";
public ProjectPermissionDetailsResponseModel(Project project, bool read, bool write, string obj = _objectName) : base(project, obj)
{
Read = read;
Write = write;
}
public ProjectPermissionDetailsResponseModel()
{
}
public bool Read { get; set; }
public bool Write { get; set; }
}

View File

@@ -7,8 +7,8 @@ public class ProjectResponseModel : ResponseModel
{
private const string _objectName = "project";
public ProjectResponseModel(Project project)
: base(_objectName)
public ProjectResponseModel(Project project, string obj = _objectName)
: base(obj)
{
if (project == null)
{