File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/IoTHub.Portal.Client/Pages/Planning Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 55@attribute [Authorize]
66
77<AuthorizedContent IsLoading =" @IsLoading" IsAuthorized =" @IsAuthorized" >
8- <EditPlanning planning =@Planning scheduleList =@ScheduleList mode =" New" CanWrite =" true " />
8+ <EditPlanning planning =@Planning scheduleList =@ScheduleList mode =" New" CanWrite =" @canWrite " />
99</AuthorizedContent >
1010
1111@code {
1212 // Specify which permissions are required for this page
1313 protected override PortalPermissions [] RequiredPermissions { get ; } = { PortalPermissions .PlanningWrite };
14+ private bool canWrite ;
1415
1516 public List <ScheduleDto > ScheduleList { get ; set ; } = new List <ScheduleDto > { };
1617 public PlanningDto Planning { get ; set ; } = new PlanningDto ();
2122
2223 Planning .DayOff = DaysEnumFlag .DaysOfWeek .Saturday | DaysEnumFlag .DaysOfWeek .Sunday ;
2324 ScheduleList .Add (new ScheduleDto { Start = " 00:00" });
25+
26+ // Check if user has write permission for conditional UI elements
27+ canWrite = await HasPermissionAsync (PortalPermissions .PlanningWrite );
2428 }
2529}
You can’t perform that action at this time.
0 commit comments