user-groups.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. title: User Groups
  2. description: Manage your User Groups in Flex.
  3. type: flex-objects
  4. # Extends user group
  5. extends@:
  6. type: group
  7. context: blueprints://user
  8. # Flex configuration
  9. config:
  10. # Administration Configuration (needs Flex Objects plugin)
  11. admin:
  12. # Admin router
  13. router:
  14. path: '/accounts/groups'
  15. actions:
  16. configure:
  17. path: '/accounts/configure'
  18. redirects:
  19. '/accounts': '/accounts/groups'
  20. # Permissions
  21. permissions:
  22. # Primary permissions
  23. admin.users:
  24. type: crudl
  25. label: User Accounts
  26. admin.configuration.users:
  27. type: default
  28. label: Accounts Configuration
  29. # Admin menu
  30. menu:
  31. base:
  32. location: '/accounts'
  33. route: '/accounts/groups'
  34. index: 1
  35. title: PLUGIN_ADMIN.ACCOUNTS
  36. icon: fa-users
  37. authorize: ['admin.users.list', 'admin.super']
  38. priority: 6
  39. # Admin template type (folder)
  40. template: user-groups
  41. # List view
  42. list:
  43. # Fields shown in the list view
  44. fields:
  45. groupname:
  46. link: edit
  47. search: true
  48. readableName:
  49. search: true
  50. description:
  51. search: true
  52. # Extra options
  53. options:
  54. per_page: 20
  55. order:
  56. by: groupname
  57. dir: asc
  58. # Edit view
  59. edit:
  60. title:
  61. template: "{{ form.value('readableName') ?? form.value('groupname') }}"
  62. # Configure view
  63. configure:
  64. hidden: true
  65. authorize: 'admin.configuration.users'
  66. form: 'accounts'
  67. title:
  68. template: "{{ 'PLUGIN_ADMIN.ACCOUNTS'|tu }} {{ 'PLUGIN_ADMIN.CONFIGURATION'|tu }}"
  69. # Site Configuration
  70. site:
  71. # Hide from flex types
  72. hidden: true
  73. templates:
  74. collection:
  75. # Lookup for the template layout files for collections of objects
  76. paths:
  77. - 'flex/{TYPE}/collection/{LAYOUT}{EXT}'
  78. object:
  79. # Lookup for the template layout files for objects
  80. paths:
  81. - 'flex/{TYPE}/object/{LAYOUT}{EXT}'
  82. defaults:
  83. # Default template {TYPE}; overridden by filename of this blueprint if template folder exists
  84. type: user-groups
  85. # Default template {LAYOUT}; can be overridden in render calls (usually Twig in templates)
  86. layout: default
  87. # Data Configuration
  88. data:
  89. object: 'Grav\Common\Flex\Types\UserGroups\UserGroupObject'
  90. collection: 'Grav\Common\Flex\Types\UserGroups\UserGroupCollection'
  91. index: 'Grav\Common\Flex\Types\UserGroups\UserGroupIndex'
  92. storage:
  93. class: 'Grav\Framework\Flex\Storage\SimpleStorage'
  94. options:
  95. formatter:
  96. class: 'Grav\Framework\File\Formatter\YamlFormatter'
  97. folder: 'user://config/groups.yaml'
  98. key: groupname
  99. search:
  100. options:
  101. contains: 1
  102. fields:
  103. - key
  104. - groupname
  105. - description
  106. blueprints:
  107. configure:
  108. fields:
  109. import@:
  110. type: configure/compat
  111. context: blueprints://flex