Comments (3)
Normally middleware would be the answer or @login_required decorators. The problem with the latter, in a CAS authenticated application, is that people are logged in, they just have an incomplete and orphaned user, so it's not enough to check for that, I think.
from wam.
Note that from: https://docs.djangoproject.com/en/2.1/ref/contrib/auth/#django.contrib.auth.backends.RemoteUserBackend
It seems possible to prevent Django from auto creating users. This may be useful because the User is created, but not the matching Staff or ExternalExaminer object.
RemoteUserBackend.create_unknown_user
True or False. Determines whether or not a user object is created if not already in the database Defaults to True.
It might be best to simply stop this behaviour for now, but some kind of self service initial registration would probably be better still.
Perhaps we need to create a new overridden version of RemoteUserBackend and hijack this function:
RemoteUserBackend.authenticate(request, remote_user)
The username passed as remote_user is considered trusted. This method simply returns the user object with the given username, creating a new user object if create_unknown_user is True.Returns None if create_unknown_user is False and a User object with the given username is not found in the database.
request is an HttpRequest and may be None if it wasn’t provided to authenticate() (which passes it on to the backend).
But, we might have to ask the user if they are Staff or an ExternalExaminer, and there are (mild) security issues with allowing them to choose their initial package, and in the case of Staff, groups, so they would still be left orphaned, so to speak, or awaiting final touches.
from wam.
All views should now be appropriately decorated and guarded to redirect to login, or show forbidden status, so hopefully no random exceptions.
from wam.
Related Issues (20)
- More stern warning needed about adding items to WorkPackage in the past HOT 1
- External Examiners and Course Directors are not copied on Clone
- Populate Database script needs to be update for new schema HOT 1
- Allow Coordinators and Moderators to be listed on the Modules index
- Users with no matching Staff Model instance should be handled more elegantly HOT 3
- Can't currently delete assessment items HOT 1
- Improve guidance for adding new Users
- Allow more guidance and / or checks for Workflow forks HOT 1
- Email on sign offs need to consider the possibility that lead_programme is not set
- Modules with Programmes from outside the WorkPackage cause clone errors HOT 3
- No assessment update emails should be sent to inactive staff HOT 1
- Sometimes incorrect help is shown for next assessment states in modules details
- Add assessment progress reporting
- Highlight the lack of a signoff more clearly HOT 1
- External Examiners should be shown in module lists with "show people" enabled
- Created Superusers at the command line have no matching Staff object HOT 1
- Allow External Examiners to defer notifications until all the assessments are ready. HOT 1
- Handle "past" signoffs better - in terms of notifications HOT 1
- Custom front-end should allow admins to delete sign offs
- Provide enhanced interface for adding assessment staff
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wam.