Skip to content

Commit

Permalink
Merge pull request #403 from OctopusDeploy/bug-5272-take2
Browse files Browse the repository at this point in the history
lets be precise about what's missing
  • Loading branch information
NickJosevski authored Apr 1, 2019
2 parents 67128da + f9cd4d6 commit 6ac1ac2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4356,7 +4356,8 @@ Octopus.Client.Model
Octopus.Client.Model.Resource
{
.ctor()
Boolean IsComplete { get; set; }
Boolean IsPermissionsComplete { get; set; }
Boolean IsTeamsComplete { get; set; }
Dictionary<Permission, List<UserPermissionRestriction>> SpacePermissions { get; set; }
List<Permission> SystemPermissions { get; set; }
List<ProjectedTeamReferenceDataItem> Teams { get; set; }
Expand Down Expand Up @@ -6027,6 +6028,7 @@ Octopus.Client.Repositories
{
Stream Export(Octopus.Client.Model.UserPermissionSetResource)
Octopus.Client.Model.UserPermissionSetResource Get(Octopus.Client.Model.UserResource)
Octopus.Client.Model.UserPermissionSetResource GetConfiguration(Octopus.Client.Model.UserResource)
}
interface IUserRepository
Octopus.Client.Repositories.IPaginate<UserResource>
Expand Down Expand Up @@ -6607,6 +6609,7 @@ Octopus.Client.Repositories.Async
{
Task<Stream> Export(Octopus.Client.Model.UserPermissionSetResource)
Task<UserPermissionSetResource> Get(Octopus.Client.Model.UserResource)
Task<UserPermissionSetResource> GetConfiguration(Octopus.Client.Model.UserResource)
}
interface IUserRepository
Octopus.Client.Repositories.Async.IPaginate<UserResource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4377,7 +4377,8 @@ Octopus.Client.Model
Octopus.Client.Model.Resource
{
.ctor()
Boolean IsComplete { get; set; }
Boolean IsPermissionsComplete { get; set; }
Boolean IsTeamsComplete { get; set; }
Dictionary<Permission, List<UserPermissionRestriction>> SpacePermissions { get; set; }
List<Permission> SystemPermissions { get; set; }
List<ProjectedTeamReferenceDataItem> Teams { get; set; }
Expand Down Expand Up @@ -6049,6 +6050,7 @@ Octopus.Client.Repositories
{
Stream Export(Octopus.Client.Model.UserPermissionSetResource)
Octopus.Client.Model.UserPermissionSetResource Get(Octopus.Client.Model.UserResource)
Octopus.Client.Model.UserPermissionSetResource GetConfiguration(Octopus.Client.Model.UserResource)
}
interface IUserRepository
Octopus.Client.Repositories.IPaginate<UserResource>
Expand Down Expand Up @@ -6629,6 +6631,7 @@ Octopus.Client.Repositories.Async
{
Task<Stream> Export(Octopus.Client.Model.UserPermissionSetResource)
Task<UserPermissionSetResource> Get(Octopus.Client.Model.UserResource)
Task<UserPermissionSetResource> GetConfiguration(Octopus.Client.Model.UserResource)
}
interface IUserRepository
Octopus.Client.Repositories.Async.IPaginate<UserResource>
Expand Down
7 changes: 6 additions & 1 deletion source/Octopus.Client/Model/UserPermissionSetResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ public class UserPermissionSetResource : Resource
/// </summary>
public List<ProjectedTeamReferenceDataItem> Teams { get; set; }

/// <summary>
/// If the requesting user had sufficient access to see a complete view of the teams that may drive permissions
/// </summary>
public bool IsTeamsComplete { get; set; }

/// <summary>
/// If the requesting user had sufficient access to see a complete view of the permissions
/// </summary>
public bool IsComplete { get; set; }
public bool IsPermissionsComplete { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public interface IUserPermissionsRepository :
ICanExtendSpaceContext<IUserPermissionsRepository>
{
Task<UserPermissionSetResource> Get(UserResource user);
Task<UserPermissionSetResource> GetConfiguration(UserResource user);
Task<Stream> Export(UserPermissionSetResource userPermissions);
}

Expand All @@ -31,7 +32,13 @@ public async Task<UserPermissionSetResource> Get(UserResource user)
if (user == null) throw new ArgumentNullException(nameof(user));
return await Client.Get<UserPermissionSetResource>(user.Link("Permissions"), GetAdditionalQueryParameters()).ConfigureAwait(false);
}


public async Task<UserPermissionSetResource> GetConfiguration(UserResource user)
{
if (user == null) throw new ArgumentNullException(nameof(user));
return await Client.Get<UserPermissionSetResource>(user.Link("PermissionsConfiguration"), GetAdditionalQueryParameters()).ConfigureAwait(false);
}

public async Task<Stream> Export(UserPermissionSetResource userPermissions)
{
if (userPermissions == null) throw new ArgumentNullException(nameof(userPermissions));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public interface IUserPermissionsRepository :
ICanExtendSpaceContext<IUserPermissionsRepository>
{
UserPermissionSetResource Get(UserResource user);
UserPermissionSetResource GetConfiguration(UserResource user);
Stream Export(UserPermissionSetResource userPermissions);
}

Expand All @@ -30,7 +31,13 @@ public UserPermissionSetResource Get(UserResource user)
if (user == null) throw new ArgumentNullException(nameof(user));
return Client.Get<UserPermissionSetResource>(user.Link("Permissions"), AdditionalQueryParameters);
}


public UserPermissionSetResource GetConfiguration(UserResource user)
{
if (user == null) throw new ArgumentNullException(nameof(user));
return Client.Get<UserPermissionSetResource>(user.Link("PermissionsConfiguration"), AdditionalQueryParameters);
}

public Stream Export(UserPermissionSetResource userPermissions)
{
if (userPermissions == null) throw new ArgumentNullException(nameof(userPermissions));
Expand Down

0 comments on commit 6ac1ac2

Please sign in to comment.