set guest user to have permission to view machines
parent
5a8af94ad7
commit
5cdf5e804f
|
@ -35,12 +35,16 @@ if not exists (select top 1 1 from PermissionHierarchy)
|
|||
begin
|
||||
declare @view_machines_permission_id int,
|
||||
@manage_machines_permission_id int,
|
||||
@operate_machines_permission_id int
|
||||
@operate_machines_permission_id int,
|
||||
@guest_access_permission_id int
|
||||
|
||||
select @view_machines_permission_id = PermissionId from Permission where PermissionCode = 'VIEW_MACHINES'
|
||||
select @manage_machines_permission_id = PermissionId from Permission where PermissionCode = 'MANAGE_MACHINES'
|
||||
select @operate_machines_permission_id = PermissionId from Permission where PermissionCode = 'OPERATE_MACHINES'
|
||||
select @guest_access_permission_id = PermissionId from Permission where PermissionCode = 'GUEST_ACCESS'
|
||||
|
||||
insert into PermissionHierarchy (ParentPermissionId, ChildPermissionId)
|
||||
values (@manage_machines_permission_id, @view_machines_permission_id), (@operate_machines_permission_id, @view_machines_permission_id)
|
||||
values (@manage_machines_permission_id, @view_machines_permission_id),
|
||||
(@operate_machines_permission_id, @view_machines_permission_id),
|
||||
(@guest_access_permission_id, @view_machines_permission_id)
|
||||
end
|
|
@ -6,6 +6,6 @@ namespace NetworkResurrector.Api.Authorization.Requirements
|
|||
public class ViewMachinesRequirement : IPermissionsBasedAuthorizationRequirement
|
||||
{
|
||||
public string[] AllRequired => Array.Empty<string>();
|
||||
public string[] OneOf => new string[] { PermissionCodes.VIEW_MACHINES, PermissionCodes.GUEST_ACCESS };
|
||||
public string[] OneOf => new string[] { PermissionCodes.VIEW_MACHINES };
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue