Skip to content

Commit

Permalink
feat: Tambahkan pengkondisian agar admin hanya bisa menghapus data tr…
Browse files Browse the repository at this point in the history
…ack dirinya sendiri
  • Loading branch information
CoderJava committed Aug 26, 2023
1 parent 0760855 commit c99f4e3
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ class _ReportScreenshotPageState extends State<ReportScreenshotPage> {
),
),
buildWidgetCountScreen(heightImage, listFiles),
buildWidgetDeleteTask(heightImage, element.id),
buildWidgetDeleteTask(heightImage, element),
],
),
),
Expand Down Expand Up @@ -789,11 +789,14 @@ class _ReportScreenshotPageState extends State<ReportScreenshotPage> {
);
}

Widget buildWidgetDeleteTask(double heightImage, int? trackId) {
if (userRole != null && userRole == UserRole.employee) {
Widget buildWidgetDeleteTask(double heightImage, ItemTrackUserResponse element) {
if (userRole == UserRole.employee) {
return Container();
} else if (userRole == UserRole.admin && userId != element.userId.toString()) {
return Container();
}

final trackId = element.id;
return Align(
alignment: Alignment.center,
child: Padding(
Expand Down

0 comments on commit c99f4e3

Please sign in to comment.