Skip to content

Commit

Permalink
Archived NOFOs can only be seen by Bloom users
Browse files Browse the repository at this point in the history
Non-bloom users can't see their archived NOFOs ever again.
  • Loading branch information
pcraig3 committed Sep 13, 2024
1 parent 5588868 commit e637d3b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
- Don't show archived NOFOs on NOFO list page
- Add warning banner for archived NOFOs to "view" and "edit" pages
- Deleting NOFOs now just archives them
- Archived NOFOs can only be seen by Bloom users

### Changed

Expand Down
5 changes: 5 additions & 0 deletions bloom_nofos/nofos/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@


def has_nofo_group_permission_func(user, nofo):
# Check if the NOFO is archived
if nofo.archived is not None:
# If archived, only 'bloom' users can access
return user.group == "bloom"

# If not a 'bloom' user and the group doesn't match, fail
if user.group != "bloom" and user.group != nofo.group:
return False
Expand Down

0 comments on commit e637d3b

Please sign in to comment.