def check_permission(request, mode_name, app_label, model_name):
    '''
    Check for proper permissions. mode_name may be either add, change or delete.
    '''
    p = '%s.%s_%s' % (app_label, mode_name, model_name)
    return request.user.is_active and request.user.has_perm(p)
dataset/ETHPy150Open bartTC/django-frontendadmin/frontendadmin/views.py/check_permission/original