def buttonItem(request, operation): #根据一项操作产生操作菜单项!!! if hasPerm(request.user, request.model, operation): return u'<li><a href="%s/data/%s/">%s</a></li>' % ( iclock_url_rel, model.__name__, model._meta.verbose_name) else: return u'<li>' + model._meta.verbose_name + '</li>'
def reqHasPerm(request, operation): #判断一个当前请求的数据模型表是否有某个权限 return hasPerm(request.user, request.model, operation)
def buttonItem(request, operation): #根据一项操作产生操作菜单项!!! if hasPerm(request.user, request.model, operation): return u'<li><a href="%s/data/%s/">%s</a></li>'%(iclock_url_rel, model.__name__, model._meta.verbose_name) else: return u'<li>'+model._meta.verbose_name+'</li>'
def reqHasPerm(request, operation): return hasPerm(request.user, request.model, operation)