Skip to content

Commit

Permalink
Fixed errors, generated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Centerville1 committed Nov 17, 2024
1 parent d05f4ca commit 97495ed
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 22 deletions.
66 changes: 46 additions & 20 deletions Gordon360/Documentation/Gordon360.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Gordon360/Services/LostAndFoundService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,17 @@ public IEnumerable<MissingItemReportViewModel> GetMissingItemsAll()
/// <returns>A Missing Item Report object, or null if no item matches the id</returns>
public MissingItemReportViewModel? GetMissingItem(int id, string username)
{
MissingItemData report;
// If user is admin, simply get the report
if (Authorization.AuthUtils.GetGroups(username).Contains(Enums.AuthGroup.LostAndFoundAdmin))
{
MissingItemData report = context.MissingItemData.FirstOrDefault(x => x.ID == id);
report = context.MissingItemData.FirstOrDefault(x => x.ID == id);
}
else
{
// Otherwise check if the report belongs to the requesting user
var idNum = context.ACCOUNT.FirstOrDefault(x => x.AD_Username == username).gordon_id;
MissingItemData report = context.MissingItemData.FirstOrDefault(x => x.ID == id && x.submitterID == idNum);
report = context.MissingItemData.FirstOrDefault(x => x.ID == id && x.submitterID == idNum);
}
return (MissingItemReportViewModel)report;
}
Expand Down

0 comments on commit 97495ed

Please sign in to comment.