Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement defensive command access #111

Conversation

narwhalsilent
Copy link

@narwhalsilent narwhalsilent commented Apr 4, 2024

Fix #97 and #110.

Defensive command access is implemented with the following features:

  • On person tab: No access to loan commands based on loan index.
  • On view all loans tab: No access to person commands based on person index.
  • On view loan of a person tab: Can only modify the person whose loan is being shown
  • On analytics tab: No access to loan and person commands based on index.

Special case:
When one viewloan a person and delete the person on that tab, one is redirected to the person tab with an empty list of persons. This modelled on the case when find only returns one person: If one delete this person, the person list will be blank.

- On person tab: No access to loan commands based on loan index.
- On view all loans tab: No access to person commands based on person index.
- On view loan of a person tab: Can only modify the person whose loan is being shown
- On analytics tab: No access to loan and person commands based on index.
Copy link

codecov bot commented Apr 4, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 46.90%. Comparing base (f86a4ea) to head (1a32dd1).

Files Patch % Lines
...rc/main/java/seedu/address/model/ModelManager.java 33.33% 2 Missing ⚠️
src/main/java/seedu/address/MainApp.java 0.00% 1 Missing ⚠️
...seedu/address/logic/commands/ViewLoansCommand.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #111      +/-   ##
============================================
+ Coverage     46.76%   46.90%   +0.14%     
- Complexity      432      433       +1     
============================================
  Files            99       99              
  Lines          2269     2275       +6     
  Branches        227      227              
============================================
+ Hits           1061     1067       +6     
  Misses         1163     1163              
  Partials         45       45              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@kjw142857 kjw142857 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kjw142857 kjw142857 merged commit e66deea into AY2324S2-CS2103T-W13-1:master Apr 4, 2024
5 checks passed
@narwhalsilent narwhalsilent linked an issue Apr 4, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mark loans without seeing them Enforce consistency in loan list displayed
2 participants