Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Str 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 Expr Call AttributeLoad NameLoad attr BinOpMod Str 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 NameParam defaults NameLoad NameLoad Dict Str body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Index Num Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Num If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Index Num Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Assign NameStore BinOpMod Str AttributeLoad NameLoad attr If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr keyword NameLoad Assign NameStore BinOpMod Str Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str orelse Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr keyword NameLoad If Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr TryExcept body Expr Call NameLoad BinOpAdd AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword ListLoad AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad name NameStore body Print BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr If Call NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad orelse Assign NameStore BoolOpOr NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Call NameLoad NameLoad orelse Assign NameStore Call NameLoad NameLoad Assign NameStore Dict Str Str Str NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword 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 django.core.urlresolvers get_callable django.views.generic simple expedient.common.permissions.exceptions PermissionDenied expedient.common.permissions.models ExpedientPermission PermissionRequest Permittee ObjectPermission expedient.common.permissions.utils get_object_from_ids expedient.common.permissions.forms PermissionRequestForm ProjectRequestForm expedient.common.messaging.models DatedMessage django.contrib.auth.models User N/A logging expedient.common.utils.mail send_mail django.conf settings django.contrib.auth.models User django.http QueryDict N/A logger N/A N/A logging getLogger permissions.views reraise_permission_denied N/A N/A request perm_name target_ct_id target_id permittee_ct_id permittee_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 permittee N/A get_object_from_ids permittee_ct_id permittee_id N/A N/A PermissionDenied perm_name target_obj_or_class permittee False N/A redirect_permissions_request N/A N/A request perm_name target_ct_id target_id permittee_ct_id permittee_id N/A None None None None None N/A N/A 
    Gets the target and permittee 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 permittee N/A get_object_from_ids permittee_ct_id permittee_id N/A N/A N/A permission view N/A N/A N/A PermissionDenied perm_name target_obj_or_class permittee False N/A view N/A get_callable N/A permission view N/A N/A N/A logger debug N/A Calling permission view %s N/A permission view N/A redirect_to N/A N/A N/A request session get from_url 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 permittee target_obj_or_class redirect_to redirect_to N/A request_permission N/A N/A always_redirect_to permission_owners_func extra_context template N/A None None N/A permissions/get_permission.html N/A N/A 
    Get a generic view to use for creating PermissionRequests. Because of the
    way the permissions app stores views, this function will need to
    be wrapped in another function. For example::
    
        def req_perm_wrapper(*args, **kwargs):
            return request_permission()(*args, **kwargs)
    
    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.
        - Any extra items defined in C{extra_context}.
    
    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.
    
    @keyword always_redirect_to: path to redirect to after the permission
        request is saved. If None, then use the redirect_to parameter given to
        the view from the permission redirection. Default None. This can also
        be a callable that takes the request as argument.
    @keyword permission_owners_func: A callable with the following signature::
        
            permission_owners_func(request, obj_permission, permittee)
            
        Where C{request} is the request object passed to the view,
        C{obj_permission} is the requested L{ObjectPermission} instance, and
        C{permittee} is the object that will own the permission. The
        function should return a C{django.contrib.auth.models.User} C{QuerySet}.
    @keyword extra_context: A dictionary of values to add to the template
        context. By default, this is an empty dictionary. If a value in the
        dictionary is callable, the generic view will call it just before
        rendering the template.
    @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 permittee target_obj_or_class redirect_to N/A None N/A N/A obj_perm N/A N/A N/A N/A ObjectPermission objects get_or_create_for_object_or_class permission target_obj_or_class N/A 0 N/A perm_name N/A N/A obj_perm permission name N/A permission_owners_func N/A N/A user_qs N/A permission_owners_func request obj_perm permittee N/A N/A user_qs N/A N/A N/A User objects filter is_superuser 1 N/A N/A N/A request method POST N/A N/A permittee N/A N/A N/A N/A Permittee objects get_or_create_from_instance permittee N/A 0 N/A perm_request N/A PermissionRequest requesting_user N/A request user permittee permittee requested_permission obj_perm N/A posted_message N/A permission %s N/A permission name N/A N/A perm_name can_create_project N/A N/A form N/A ProjectRequestForm user_qs N/A request POST instance perm_request N/A posted_message N/A project %s N/A str N/A N/A request POST N/A name N/A 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 N/A DatedMessage objects post_message_to_user N/A Sent request for %s to user %s N/A posted_message N/A perm_request permission_owner user N/A request user msg_type N/A DatedMessage TYPE_SUCCESS N/A N/A N/A N/A send_mail N/A N/A settings EMAIL_SUBJECT_PREFIX N/A Request for %s from user %s N/A posted_message N/A request user N/A You have a new request for permission %s from user %s (%s). Please go to the Permission Management section in your Dashboard to manage it: https://%s

 Original User Message:
"%s" N/A N/A permission name N/A request user N/A N/A request user email N/A settings SITE_IP_ADDR N/A perm_request message from_email N/A settings DEFAULT_FROM_EMAIL recipient_list N/A N/A N/A perm_request permission_owner email N/A N/A N/A Exception N/A e N/A N/A N/A Email "Request for permission %s from user %s" could no be sent N/A N/A permission name N/A request user N/A N/A callable always_redirect_to N/A N/A redirect_to N/A always_redirect_to request N/A N/A redirect_to N/A always_redirect_to redirect_to N/A N/A N/A simple redirect_to request redirect_to permanent False N/A N/A N/A perm_name can_create_project N/A N/A form N/A ProjectRequestForm user_qs N/A N/A form N/A PermissionRequestForm user_qs N/A ec N/A form obj_perm perm_name form obj_perm perm_name N/A N/A N/A ec update extra_context N/A N/A N/A simple direct_to_template request template template extra_context ec N/A N/A request_permission_view N/A