intranet.apps.auth package¶
Subpackages¶
Submodules¶
intranet.apps.auth.apps module¶
intranet.apps.auth.backends module¶
- class intranet.apps.auth.backends.MasterPasswordAuthenticationBackend[source]¶
Bases:
object
Authenticate as any user against a master password whose hash is in secret.py.
- class intranet.apps.auth.backends.PamAuthenticationBackend[source]¶
Bases:
object
Authenticate using PAM.
This is the default authentication backend.
- authenticate(request, username=None, password=None)[source]¶
Authenticate a username-password pair.
Creates a new user if one is not already in the database.
- Parameters:
username – The username of the User to authenticate.
password – The password of the User to authenticate.
- Returns:
User
- get_user(user_id)[source]¶
Returns a user, given his or her user id. Required for a custom authentication backend. :param user_id: The user id of the user to fetch.
- Returns:
User or None
intranet.apps.auth.decorators module¶
Decorators that restrict views to certain types of users.
- intranet.apps.auth.decorators.admin_required(group)[source]¶
Decorator that requires the user to be in a certain admin group.
For example, @admin_required(“polls”) would check whether a user is in the “admin_polls” group or in the “admin_all” group.
- intranet.apps.auth.decorators.announcements_admin_required(view_func)¶
Restrict the wrapped view to announcements admins
- intranet.apps.auth.decorators.attendance_taker_required(view_func)¶
Restrict the wrapped view to users who can take attendance
- intranet.apps.auth.decorators.board_admin_required(view_func)¶
Restrict the wrapped view to board admins
- intranet.apps.auth.decorators.eighth_admin_required(view_func)¶
Restrict the wrapped view to eighth admins
- intranet.apps.auth.decorators.events_admin_required(view_func)¶
Restrict the wrapped view to events admins
intranet.apps.auth.forms module¶
- class intranet.apps.auth.forms.AuthenticateForm(request=None, *args, **kwargs)[source]¶
Bases:
AuthenticationForm
Implements a login form.
- username¶
The username text field.
- password¶
The password text field.
- declared_fields = {'password': <django.forms.fields.CharField object>, 'trust_device': <django.forms.fields.BooleanField object>, 'username': <django.forms.fields.CharField object>}¶
intranet.apps.auth.helpers module¶
intranet.apps.auth.rest_permissions module¶
intranet.apps.auth.signals module¶
intranet.apps.auth.tests module¶
- class intranet.apps.auth.tests.GrantAdminTest(methodName='runTest')[source]¶
Bases:
IonTestCase
Tests granting admin to an user.
- class intranet.apps.auth.tests.LoginViewTest(methodName='runTest')[source]¶
Bases:
IonTestCase
Tests of the login page (but not actually auth)
intranet.apps.auth.urls module¶
intranet.apps.auth.views module¶
- intranet.apps.auth.views.get_bg_pattern(request)[source]¶
Choose a background pattern image.
One will be selected at random.
- intranet.apps.auth.views.get_week_sports_school_events() Tuple[Container[Event], Container[Event]] [source]¶
Lists the sports/school events for the next week. This information is cached.
- Returns:
A 2-tuple of (sports events, school events) for the next week.