mirror of https://github.com/portainer/portainer
15 lines
454 B
JavaScript
15 lines
454 B
JavaScript
|
export default function AccessViewerPolicyModel(policy, endpoint, roles, group, team) {
|
||
|
this.EndpointId = endpoint.Id;
|
||
|
this.EndpointName = endpoint.Name;
|
||
|
this.RoleId = policy.RoleId;
|
||
|
this.RoleName = roles[policy.RoleId].Name;
|
||
|
if (group) {
|
||
|
this.GroupId = group.Id;
|
||
|
this.GroupName = group.Name
|
||
|
}
|
||
|
if (team) {
|
||
|
this.TeamId = team.Id;
|
||
|
this.TeamName = team.Name;
|
||
|
}
|
||
|
this.AccessLocation = group ? 'endpoint group' : 'endpoint';
|
||
|
}
|