Auth Views

Source is located in the views, which we’ll describe here.

Crudlfa+ PasswordView, Become and BecomeUser views.

Crudlfa+ takes views further than Django and are expected to:

  • generate their URL definitions and reversions,

  • check if a user has permission for an object,

  • declare the names of the navigation menus they belong to.

class crudlfap_auth.views.Become(**kwargs)[source]
has_perm()[source]

Called to decide if user has the permission to execute this view.

This is what you should override to code view level permission logic, unless you want to use a Django permission backend.

If unsure, you probably need to just define Router.has_perm.

Default behaviour:

  • return True if the view authenticate attribute has been overridden to False

  • return self.router.has_perm(self) if the view has a router

  • return self.has_perm_backend otherwise, to let a Django permission backend decide

class crudlfap_auth.views.BecomeUser(**kwargs)[source]
become()[source]

Implement this method to override the default become logic.

get_object(queryset=None)[source]

Return the object the view is displaying.

Require self.queryset and a pk or slug argument in the URLconf. Subclasses can override this to return any object.

get_title_menu()[source]

Return title for menu links to this view.

class crudlfap_auth.views.PasswordView(**kwargs)[source]
get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

get_title_submit()[source]

Title of the submit button.

Defaults to title_menu