Package omeroweb :: Module decorators :: Class login_required
[hide private]
[frames] | no frames]

Class login_required

source code


OMERO.web specific extension of the Django login_required() decorator, https://docs.djangoproject.com/en/dev/topics/auth/, which is responsible for ensuring a valid omero.gateway.BlitzGateway connection. Is configurable by various options.

Instance Methods [hide private]
 
__init__(self, useragent='OMERO.web', isAdmin=False, isGroupOwner=False, doConnectionCleanup=True, omero_group='-1', allowPublic=None)
Initialises the decorator.
source code
 
__getattr__(self, name) source code
 
get_login_url(self)
The URL that should be redirected to if not logged in.
source code
 
login_url(self)
The URL that should be redirected to if not logged in.
source code
 
get_share_connection(self, request, conn, share_id) source code
 
prepare_share_connection(self, request, conn, share_id)
Prepares the share connection if we have a valid share ID.
source code
 
on_not_logged_in(self, request, url, error=None)
Called whenever the user is not logged in.
source code
 
on_logged_in(self, request, conn)
Called whenever the users is successfully logged in.
source code
 
on_share_connection_prepared(self, request, conn_share)
Called whenever a share connection is successfully prepared.
source code
 
verify_is_admin(self, conn)
If we have been requested to by the isAdmin flag, verify the user is an admin and raise an exception if they are not.
source code
 
verify_is_group_owner(self, conn, gid)
If we have been requested to by the isGroupOwner flag, verify the user is the owner of the provided group.
source code
 
is_valid_public_url(self, server_id, request)
Verifies that the URL for the resource being requested falls within the scope of the OMERO.webpublic URL filter.
source code
 
get_public_user_connector(self)
Returns the current cached OMERO.webpublic connector or None if nothing has been cached.
source code
 
set_public_user_connector(self, connector)
Sets the current cached OMERO.webpublic connector.
source code
 
get_connection(self, server_id, request)
Prepares a Blitz connection wrapper (from omero.gateway) for use with a view function.
source code
 
get_authenticated_connection(self, server_id, request)
Prepares an authenticated Blitz connection wrapper (from omero.gateway) for use with a view function.
source code
 
__call__(ctx, f)
Tries to prepare a logged in connection, then calls function and returns the result.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, useragent='OMERO.web', isAdmin=False, isGroupOwner=False, doConnectionCleanup=True, omero_group='-1', allowPublic=None)
(Constructor)

source code 

Initialises the decorator.

Overrides: object.__init__

on_logged_in(self, request, conn)

source code 

Called whenever the users is successfully logged in. Sets the 'omero.group' option if specified in the constructor

verify_is_group_owner(self, conn, gid)

source code 

If we have been requested to by the isGroupOwner flag, verify the user is the owner of the provided group. If no group is provided the user's active session group ownership will be verified.