f_find_fx_user_power.srf 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. $PBExportHeader$f_find_fx_user_power.srf
  2. $PBExportComments$(协同)根据funcid查找当前用户是否具有该权限
  3. global type f_find_fx_user_power from function_object
  4. end type
  5. forward prototypes
  6. global function long f_find_fx_user_power (long arg_funcid, ref string arg_msg)
  7. end prototypes
  8. global function long f_find_fx_user_power (long arg_funcid, ref string arg_msg);long ret = 0
  9. if not IsValid(sys_func_pwr) then
  10. ret = 0
  11. arg_msg = '权限对象有误,请联系开发人员'
  12. goto ext
  13. end if
  14. if IsNull(sys_func_pwr) then
  15. ret = 0
  16. arg_msg = '权限对象有误(null),请联系开发人员'
  17. goto ext
  18. end if
  19. sys_func_pwr.SetFilter('')
  20. sys_func_pwr.Filter()
  21. long row = 0
  22. row = sys_func_pwr.Find('funcid = ' + string(arg_funcid), 1, sys_func_pwr.RowCount())
  23. if (row > 0) then
  24. ret = 1
  25. goto ext
  26. else
  27. ret = 0
  28. row = sys_func_all.Find('funcid = ' + string(arg_funcid), 1, sys_func_all.RowCount())
  29. if (row > 0) then
  30. arg_msg += '您没有"' + sys_func_all.Object.treename[row] + '"的权限,[' + string(arg_funcid) + ']~r~n'
  31. else
  32. arg_msg += '协同系统不存在该权限,[' + string(arg_funcid) + ']~r~n'
  33. end if
  34. goto ext
  35. end if
  36. ext:
  37. return ret
  38. //if (f_find_fx_user_power(0000, ref arg_msg) = 1) then
  39. //
  40. //end if
  41. end function