Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Raise Call NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore Call NameLoad NameLoad NameLoad If CompareEq Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad If UnaryOpNot AttributeLoad NameLoad attr body Raise Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Str If BoolOpOr UnaryOpNot NameLoad CompareIn Str NameLoad CompareIn Str NameLoad body Assign NameStore NameLoad Return Call NameLoad NameLoad NameLoad NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Str body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Assign NameStore SubscriptLoad Call NameLoad NameLoad NameLoad Index Num If NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call NameLoad keyword NameLoad keyword NameLoad Dict If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr keyword NameLoad If Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad orelse Assign NameStore Call NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Dict Str Str NameLoad NameLoad decorator_list Return NameLoad decorator_list
N/A N/A 
Created on Jun 6, 2010

@author: jnaous
 django.contrib.contenttypes.models ContentType django.shortcuts get_object_or_404 expedient.common.permissions.exceptions PermissionDenied expedient.common.permissions.models ExpedientPermission PermissionRequest PermissionUser expedient.common.permissions.utils get_object_from_ids register_permission_for_obj_or_class django.core.urlresolvers get_callable expedient.common.permissions.forms PermissionRequestForm django.views.generic simple create_update django.contrib.auth.models User reraise_permission_denied N/A N/A request perm_name target_ct_id target_id user_ct_id user_id N/A None None None None None N/A N/A 
    Raises a PermissionDenied exception for the given parameters.
     N/A target_obj_or_class N/A get_object_from_ids target_ct_id target_id N/A user N/A get_object_from_ids user_ct_id user_id N/A N/A PermissionDenied perm_name target_obj_or_class user False N/A redirect_permissions_request N/A N/A request perm_name target_ct_id target_id user_ct_id user_id N/A None None None None None N/A N/A 
    Gets the target and user objects and passes them along with the 
    L{ExpedientPermission} object named by C{perm_name} to the view that's
    used by the permission.
     N/A permission N/A get_object_or_404 ExpedientPermission name perm_name N/A target_obj_or_class N/A get_object_from_ids target_ct_id target_id N/A N/A N/A type target_obj_or_class ContentType N/A N/A target_obj_or_class N/A N/A target_obj_or_class model_class N/A user N/A get_object_from_ids user_ct_id user_id N/A N/A N/A permission view N/A N/A N/A PermissionDenied perm_name target_obj_or_class user False N/A view N/A get_callable N/A permission view N/A redirect_to N/A N/A N/A request GET get next N/A N/A N/A redirect_to N/A redirect_to N/A // redirect_to N/A N/A redirect_to None N/A N/A view request permission user target_obj_or_class redirect_to redirect_to N/A request_permission N/A N/A always_redirect_to permission_owners_func template N/A None permissions/get_permission.html N/A N/A 
    Get a generic view to use for creating PermissionRequests.
    
    The view's template context will have:
    - C{form}: the form to show the user. By default, this is a
        L{PermissionRequestForm}
    - C{obj_perm}: the L{ObjectPermission} instance requested.
    
    The form will show all users that can delegate the requested permission by
    default. To change the shown set, specify C{permission_owners_func} which
    should return the set to show.
    
    @param always_redirect_to: path to redirect to after the permission request
        is saved.
    @keyword permission_owners_func: A callable with the following signature::
        
            permission_owners_func(request, obj_permission, user)
            
        Where C{request} is the request object passed to the view,
        C{obj_permission} is the requested L{ObjectPermission} instance, and
        C{user} is the object that the permission is being requested for. The
        function should return {django.contrib.auth.models.User} C{QuerySet}.
    @keyword template: Path of the template to use. By default, this is
        "permissions/get_permission.html".
     request_permission_view N/A N/A request permission user target_obj_or_class redirect_to N/A None N/A N/A obj_perm N/A N/A register_permission_for_obj_or_class target_obj_or_class permission N/A 0 N/A permission_owners_func N/A N/A user_qs N/A permission_owners_func request obj_perm user N/A N/A user_qs N/A N/A N/A PermissionUser objects get_objects_queryset User N/A dict permissioninfo__obj_permission obj_perm permissioninfo__can_delegate True N/A N/A N/A N/A request method POST N/A N/A perm_request N/A PermissionRequest requesting_user N/A request user requested_permission obj_perm N/A form N/A PermissionRequestForm user_qs N/A request POST instance perm_request N/A N/A N/A form is_valid N/A N/A perm_request N/A N/A form save N/A N/A N/A simple redirect_to request always_redirect_to permanent False N/A N/A form N/A PermissionRequestForm user_qs N/A N/A N/A simple direct_to_template request template template extra_context N/A form obj_perm form obj_perm N/A N/A request_permission_view N/A