Authentication & Permissions

It’s up to the responsibility of the user to implement permissions by providing their own Authenticator subclass.

class flask_kibble.Authenticator
can_upload_file(file)

Check if the user is eligible to upload a file. If not, the uploaded file will be deleted.

Parameters:file – A Blobinfo or Fileinfo object.
get_login_url()

Should return a URL the user can use to log in.

has_permission_for(model, action, key=None, **view_args)

Should return true if the current user has the permissions for the Model/Action/ViewArgs.

Parameters:
  • model – The model class that is being operated on, or None (for non-CBVs).
  • action – The KibbleView.action that is being executed or the name of the view (for non-CBVs)
  • key – The ndb.Key of the object currently operating on.
  • **view_args – The current view args.
Return type:

bool

is_logged_in()

Should return true if the current user is logged in.

Return type:bool
class flask_kibble.GAEAuthenticator(admin_only=False)

Authenticator for Google App Engine accounts (google.appengine.api.users).

Will grant all permissions to all GAE accounts, or all GAE administrators.