Skip to content

Commit

Permalink
added edit policy
Browse files Browse the repository at this point in the history
Signed-off-by: Abdul-Az <aazeez@progress.com>
  • Loading branch information
iamazzeez authored and vinay033 committed Apr 13, 2022
1 parent 364614b commit ae480dd
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 35 deletions.
4 changes: 2 additions & 2 deletions api/external/infra_proxy/infra_proxy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ service InfraProxy {
option (google.api.http).post = "/api/v0/infra/servers/{server_id}/orgs/{org_id}/roles";
option (google.api.http).body = "*";
option (chef.automate.api.iam.policy).resource = "infra:infraServers:{server_id}:orgs:{org_id}:roles";
option (chef.automate.api.iam.policy).action = "infra:infraServersOrgsRoles:update";
option (chef.automate.api.iam.policy).action = "infra:infraServersOrgsRoles:create";
};
rpc DeleteRole (infra_proxy.request.Role) returns (infra_proxy.response.Role) {
option (google.api.http).delete = "/api/v0/infra/servers/{server_id}/orgs/{org_id}/roles/{name}";
Expand All @@ -154,7 +154,7 @@ service InfraProxy {
option (google.api.http).put = "/api/v0/infra/servers/{server_id}/orgs/{org_id}/roles/{name}";
option (google.api.http).body = "*";
option (chef.automate.api.iam.policy).resource = "infra:infraServers:{server_id}:orgs:{org_id}:roles";
option (chef.automate.api.iam.policy).action = "infra:infraServers:update";
option (chef.automate.api.iam.policy).action = "infra:infraServersOrgsRoles:update";
};

rpc GetClients (infra_proxy.request.Clients) returns (infra_proxy.response.Clients) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@
<chef-icon>remove_circle</chef-icon>
<span>Collapse All</span>
</chef-button>
<chef-button
tertiary
class="float-right action"
(click)="openEditModal(role?.default_attributes, 'Run List')"
[disabled]="editDisabled">
<span class="material-icons edit-item">mode_edit</span>
<span class="edit-text">Edit</span>
</chef-button>
<app-authorized [allOf]="['/api/v0/infra/servers/{server_id}/orgs/{org_id}/roles/{name}', 'put', [serverId, orgId, role?.name]]">
<chef-button
tertiary
class="float-right action"
(click)="openEditModal(role?.default_attributes, 'Run List')"
[disabled]="editDisabled">
<span class="material-icons edit-item">mode_edit</span>
<span class="edit-text">Edit</span>
</chef-button>
</app-authorized>
</div>
<div *ngIf="hasRun_List">
<div class="expand-collapse">
Expand All @@ -101,15 +103,17 @@
<chef-icon>remove_circle</chef-icon>
<span>Collapse All</span>
</chef-button>
<chef-button
tertiary
class="float-right action"
(click)="openEditModal(role?.default_attributes, 'Run List')"
data-cy="edit-runlist"
[disabled]="editDisabled">
<span class="material-icons edit-item">mode_edit</span>
<span class="edit-text">Edit</span>
</chef-button>
<app-authorized [allOf]="['/api/v0/infra/servers/{server_id}/orgs/{org_id}/roles/{name}', 'put', [serverId, orgId, role?.name]]">
<chef-button
tertiary
class="float-right action"
(click)="openEditModal(role?.default_attributes, 'Run List')"
data-cy="edit-runlist"
[disabled]="editDisabled">
<span class="material-icons edit-item">mode_edit</span>
<span class="edit-text">Edit</span>
</chef-button>
</app-authorized>
</div>
<app-tree-table
[hidden]="hasRun_List ? false : true"
Expand Down Expand Up @@ -160,14 +164,16 @@
<chef-icon>remove_circle</chef-icon>
<span>Collapse All</span>
</chef-button>
<chef-button
tertiary
class="float-right"
(click)="openEditModal(role?.default_attributes, 'Default')"
data-cy="edit-default-attribute">
<span class="material-icons edit-item">mode_edit</span>
<span class="edit-text">Edit</span>
</chef-button>
<app-authorized [allOf]="['/api/v0/infra/servers/{server_id}/orgs/{org_id}/roles/{name}', 'put', [serverId, orgId, role?.name]]">
<chef-button
tertiary
class="float-right"
(click)="openEditModal(role?.default_attributes, 'Default')"
data-cy="edit-default-attribute">
<span class="material-icons edit-item">mode_edit</span>
<span class="edit-text">Edit</span>
</chef-button>
</app-authorized>
</div>
<app-json-tree-table class="json-container"
[hidden]="hasDefaultJson ? false : true"
Expand Down Expand Up @@ -202,14 +208,16 @@
<chef-icon>remove_circle</chef-icon>
<span>Collapse All</span>
</chef-button>
<chef-button
tertiary
class="float-right action"
(click)="openEditModal(role?.override_attributes, 'Override')"
data-cy="edit-override-attribute">
<span class="material-icons edit-item">mode_edit</span>
<span class="edit-text">Edit</span>
</chef-button>
<app-authorized [allOf]="['/api/v0/infra/servers/{server_id}/orgs/{org_id}/roles/{name}', 'put', [serverId, orgId, role?.name]]">
<chef-button
tertiary
class="float-right action"
(click)="openEditModal(role?.override_attributes, 'Override')"
data-cy="edit-override-attribute">
<span class="material-icons edit-item">mode_edit</span>
<span class="edit-text">Edit</span>
</chef-button>
</app-authorized>
</div>
<app-json-tree-table class="json-container"
[hidden]="hasOverrideJson ? false : true"
Expand Down

0 comments on commit ae480dd

Please sign in to comment.