コード例 #1
0
def user_is_context_owner(context, owner_id=None):
    """Test if current user is the context owner e.g. to check if someone 
    manipulating the context object is other than the owner of the object.
    
    Assimption: context is IOwned.
    
    A delegate is considered to be an owner of the object.
    """
    if owner_id:
        return model_utils.is_current_or_delegated_user(owner_id)
    return model_utils.is_current_or_delegated_user(context.owner_id)
コード例 #2
0
def user_is_context_owner(context, owner_id=None):
    """Test if current user is the context owner e.g. to check if someone 
    manipulating the context object is other than the owner of the object.
    
    Assimption: context is IOwned.
    
    A delegate is considered to be an owner of the object.
    """
    if owner_id:
        return model_utils.is_current_or_delegated_user(owner_id)
    return model_utils.is_current_or_delegated_user(context.owner_id)
コード例 #3
0
def user_is_context_owner(context):
    """Test if current user is the context owner e.g. to check if someone 
    manipulating the context object is other than the owner of the object.
        
    A delegate is considered to be an owner of the object
    """
    owner = utils.get_owner_pi(context)
    return model_utils.is_current_or_delegated_user(owner)
コード例 #4
0
def user_is_context_owner(context):
    """Test if current user is the context owner e.g. to check if someone 
    manipulating the context object is other than the owner of the object.
        
    A delegate is considered to be an owner of the object
    """
    owner = utils.get_owner_pi(context)
    return model_utils.is_current_or_delegated_user(owner)
コード例 #5
0
ファイル: utils.py プロジェクト: BenoitTalbot/bungeni-portal
def user_is_context_owner(context):
    """Test if current user is the context owner e.g. to check if someone 
    manipulating the context object is other than the owner of the object.
    
    Assumption: context is IOwned.
    
    A delegate is considered to be an owner of the object.
    """
    user = _determine_related_user(context, user_attr_name="owner")
    return is_current_or_delegated_user(user)
コード例 #6
0
def user_is_context_owner(context):
    """Test if current user is the context owner e.g. to check if someone 
    manipulating the context object is other than the owner of the object.
    
    Assumption: context is IOwned.
    
    A delegate is considered to be an owner of the object.
    """
    user = _determine_related_user(context, user_attr_name="owner")
    return is_current_or_delegated_user(user)