26.authgroupupdate.mql 801 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. select _group from /matrix/group where name = 'admin' refresh
  2. /**
  3. output()
  4. **/
  5. ;
  6. update /matrix/group set _group = null where name = 'admin'
  7. ;
  8. select _group from /matrix/group where name = 'admin' refresh
  9. /**
  10. output()
  11. matchcount(`_group`, nil, 1)
  12. **/
  13. ;
  14. update /matrix/group set _group = _group + ? where name in ?
  15. /**
  16. params({"add": ["网络部"], "delete": ["网络部"], "edit": ["网络部"], "list": ["网络部"]}, ["admin"])
  17. **/
  18. ;
  19. select _group from /matrix/group where name = 'admin' refresh
  20. /**
  21. output()
  22. matchcount(`_group.delete.0`, "网络部", 1)
  23. **/
  24. ;
  25. update /matrix/group set _group = _group + ? where name in ?
  26. /**
  27. params({"add": ["市场部"]}, ["admin"])
  28. **/
  29. ;
  30. select _group from /matrix/group where name = 'admin' refresh
  31. /**
  32. output()
  33. matchcount(`_group.add.len`, 2, 1)
  34. **/
  35. ;