exp_perms.c 711 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include <grass/gis.h>
  2. #include <grass/glocale.h>
  3. char *explain_perms(int group, int other, int will)
  4. {
  5. static char buf[256];
  6. char *who;
  7. char *verb;
  8. char *read;
  9. verb = _("have");
  10. read = _("read ");
  11. read = ""; /* remove this to have "read" appear */
  12. if (group && other) {
  13. who = _("Everyone");
  14. verb = _("has");
  15. }
  16. else if (group) {
  17. who = _("Only users in your group");
  18. }
  19. else if (other) {
  20. who = _("Only users outside your group");
  21. }
  22. else {
  23. who = _("Only you");
  24. read = "";
  25. }
  26. if (will)
  27. verb = _("have");
  28. sprintf(buf, _("%s %s %s %saccess to mapset %s"),
  29. who, will ? _("will") : _("now"), verb, read, G_mapset());
  30. return buf;
  31. }