-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/user models #61
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
Open
XanderVertegaal
wants to merge
48
commits into
develop
Choose a base branch
from
feature/user-models
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
fc79f61
Add Icon Button Component
XanderVertegaal c7d3134
Add copy button
XanderVertegaal c55719c
Avoid unnecessary requests
XanderVertegaal 5440a8a
Compare route params
XanderVertegaal d42d1e2
Add base field to form
XanderVertegaal 7b4796f
Add base field to Problem
XanderVertegaal e7da8fc
Use Problem.field in problem views
XanderVertegaal 07297b3
Use update_or_create for sentences
XanderVertegaal aadfd32
Use base field in frontend
XanderVertegaal 60a2e5a
Simplify Annotate component template
XanderVertegaal bcb27e9
Keep queryParams after form update
XanderVertegaal a68c25a
Fix failing tests
XanderVertegaal 1e089b0
Merge branch 'feature/user-problems' into feature/derived-problems
XanderVertegaal 658a1fe
Add base field to serializer
XanderVertegaal 8c23335
Add Replace ViewMode with AppMode in ProblemDetailsComponent
XanderVertegaal d0e0d34
Remove unused import
XanderVertegaal c06aa05
Merge branch 'feature/user-problems' into feature/derived-problems
XanderVertegaal e49e3d6
Add role field to User model
XanderVertegaal d627060
Add role to serializer
XanderVertegaal 26a629b
Implement frontend add/edit checks
XanderVertegaal 1bd7eea
Route guard
XanderVertegaal b3d717f
Role-based user icons
XanderVertegaal 63d8684
Add backend permission checks
XanderVertegaal fde5405
Tweak admin and serializer
XanderVertegaal a5c44c5
Wait in CanEditOrAddGuard
XanderVertegaal 7e75de2
Fix route guard
XanderVertegaal aff8c7b
Fix frontend tests
XanderVertegaal e940059
Fix backend tests
XanderVertegaal 7897f67
Merge branch 'feature/user-problems' into feature/derived-problems
XanderVertegaal 0428b12
Outfactor util
XanderVertegaal 5006b4c
Set base in serializer
XanderVertegaal 873b040
Reinstate IconButton for non-navigational buttons
XanderVertegaal b4ec78d
Remove unused imports
XanderVertegaal bea3b3e
Silence Python type warning
XanderVertegaal 2ef9935
Return base correctly
XanderVertegaal f43bd3f
Avoid duplicate results upon filtering
XanderVertegaal 7188e7f
Outfactor general utility function
XanderVertegaal 5b3cbeb
Merge branch 'feature/derived-problems' into feature/user-models
XanderVertegaal ecbb706
Remove User.role; use Django permission system instead
XanderVertegaal 5b5c941
Add data migration for user groups
XanderVertegaal bb034f7
Document user permissions
XanderVertegaal 31bac00
Use new permission checks in frontend
XanderVertegaal 045a612
Major Tom
XanderVertegaal b169462
Fix DRF Permission classes
XanderVertegaal 856832e
Reuse permissions in tests
XanderVertegaal 27f7a0f
Fix failing tests
XanderVertegaal 5acbcb0
Use appropriate casing
XanderVertegaal 49fadb4
Fix frontend tests as well
XanderVertegaal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,69 @@ | ||
| # LangPro Annotator | ||
|
|
||
| [](https://github.com/CentreForDigitalHumanities/langpro-annotator/actions) | ||
|
|
||
| An annotation tool for LangPro, a tableau-based theorem prover for natural logic and language. | ||
|
|
||
| *This repository is a work in progress, and the README is not yet complete!* | ||
|
|
||
| ## Introduction | ||
|
|
||
| *In this section, provide an overview of your code and describe the project in which the code was developed. Highlight the purpose, scope, and potential uses of your code. Also, consider including links to relevant publications or resources that provide additional context.* | ||
|
|
||
| ## Getting started | ||
|
|
||
| LangPro Annotator is a web application: it can be accessed using a web browser. | ||
|
|
||
| *If you are hosting LangPro Annotator anywhere, provide a URL and any additional info.* | ||
|
|
||
| You can also run LangPro Annotator locally or host it yourself. Be aware that this is a more advanced option. See [CONTRIBUTING.md](./CONTRIBUTING.md) for information about setting up a local server or configuring deployment. | ||
|
|
||
| ## Usage | ||
|
|
||
| *Provide information about what LangPro Annotator can be used for. If you have written a user manual, this is the place to link it!* | ||
|
|
||
| ## Development | ||
|
|
||
| To get started with developing LangPro Annotator, see [CONTRIBUTING.md](./CONTRIBUTING.md). | ||
|
|
||
| ## Licence | ||
|
|
||
| This work is shared under a BSD 3-Clause licence. See [LICENSE](./LICENSE) for more information. | ||
|
|
||
| ## Citation | ||
|
|
||
| To cite this repository, please use the metadata provided in [CITATION.cff](./CITATION.cff). | ||
|
|
||
| ## Contact | ||
|
|
||
| LangPro Annotator is developed by [Research Software Lab, Centre for Digital Humanities, Utrecht University](https://cdh.uu.nl/about/research-software-lab/). | ||
|
|
||
| *Include contact information. You can also provide clear instructions for how users can provide feedback, contribute, or suggest improvements to your work.* | ||
| # LangPro Annotator | ||
|
|
||
| [](https://github.com/CentreForDigitalHumanities/langpro-annotator/actions) | ||
|
|
||
| An annotation tool for LangPro, a tableau-based theorem prover for natural logic and language. | ||
|
|
||
| *This repository is a work in progress, and the README is not yet complete!* | ||
|
|
||
| ## Introduction | ||
|
|
||
| *In this section, provide an overview of your code and describe the project in which the code was developed. Highlight the purpose, scope, and potential uses of your code. Also, consider including links to relevant publications or resources that provide additional context.* | ||
|
|
||
| ## Getting started | ||
|
|
||
| LangPro Annotator is a web application: it can be accessed using a web browser. | ||
|
|
||
| *If you are hosting LangPro Annotator anywhere, provide a URL and any additional info.* | ||
|
|
||
| You can also run LangPro Annotator locally or host it yourself. Be aware that this is a more advanced option. See [CONTRIBUTING.md](./CONTRIBUTING.md) for information about setting up a local server or configuring deployment. | ||
|
|
||
| ## Usage | ||
|
|
||
| *Provide information about what LangPro Annotator can be used for. If you have written a user manual, this is the place to link it!* | ||
|
|
||
| ## Development | ||
|
|
||
| To get started with developing LangPro Annotator, see [CONTRIBUTING.md](./CONTRIBUTING.md). | ||
|
|
||
| ## Permission overview | ||
|
|
||
| Apart from superusers/admins, the application has three user roles with different permissions. Users with the "Master Annotator" role have full permissions, including managing users and problem visibility/status. Users with the "Annotator" role can browse and annotate both gold and silver problems. Users without any assigned role are considered "Visitors" and can only browse gold problems. | ||
|
|
||
| Users can become Annotators or Master Annotators by adding them to the respective user groups in the Django admin interface. | ||
|
|
||
| The matrix below shows the permissions for each role. Not all permissions are currently implemented. | ||
|
|
||
| (Last updated: November 14th, 2025) | ||
|
|
||
| | | Visitor | Annotator | Master Annotator | | ||
| | -------------------------- | ------- | --------- | ---------------- | | ||
| | Browse gold problems | Yes | Yes | Yes | | ||
| | Browse silver problems | No | Yes | Yes | | ||
| | Edit KB items | No | Yes | Yes | | ||
| | Add labels | No | Yes | Yes | | ||
| | Remove own labels | No | Yes | Yes | | ||
| | Remove other users' labels | No | No | Yes | | ||
| | Add problems | No | No | Yes | | ||
| | Copy problems | No | No | Yes | | ||
| | Update user problems | No | No | Yes | | ||
| | Delete problems | No | No | Yes | | ||
| | Edit existing problems | No | No | Yes | | ||
| | See hidden problems | No | No | Yes | | ||
| | Silver/gold problems | No | No | Yes | | ||
| | Hide/unhide problems | No | No | Yes | | ||
| | Manage users | No | No | Yes | | ||
|
|
||
| ## Licence | ||
|
|
||
| This work is shared under a BSD 3-Clause licence. See [LICENSE](./LICENSE) for more information. | ||
|
|
||
| ## Citation | ||
|
|
||
| To cite this repository, please use the metadata provided in [CITATION.cff](./CITATION.cff). | ||
|
|
||
| ## Contact | ||
|
|
||
| LangPro Annotator is developed by [Research Software Lab, Centre for Digital Humanities, Utrecht University](https://cdh.uu.nl/about/research-software-lab/). | ||
|
|
||
| *Include contact information. You can also provide clear instructions for how users can provide feedback, contribute, or suggest improvements to your work.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Generated by Django 4.2.20 on 2025-09-22 11:47 | ||
|
|
||
| from django.db import migrations, models | ||
| import django.db.models.deletion | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("problem", "0004_sentence_remove_problem_premises_knowledgebase_and_more"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="problem", | ||
| name="base", | ||
| field=models.ForeignKey( | ||
| blank=True, | ||
| help_text="The base problem from which this problem was derived, if any.", | ||
| null=True, | ||
| on_delete=django.db.models.deletion.SET_NULL, | ||
| related_name="derived_problems", | ||
| to="problem.problem", | ||
| ), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Generated by Django 4.2.27 on 2025-12-08 13:23 | ||
|
|
||
| from django.db import migrations | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("problem", "0005_problem_base"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterModelOptions( | ||
| name="problem", | ||
| options={ | ||
| "permissions": [ | ||
| ("view_gold_problems", "Can view problems marked as gold"), | ||
| ("view_silver_problems", "Can view problems marked as silver"), | ||
| ("view_hidden_problems", "Can view hidden problems that are marked as hidden"), | ||
| ("copy_problems", "Can copy problems"), | ||
| ("change_problem_status", "Can change status of a problem (gold/silver)"), | ||
| ("change_problem_visibility", "Can change problem visibility (hidden/visible)"), | ||
| ] | ||
| }, | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you actually remove two blank lines here, or is GitHub's diff viewer fooling me?