This repository has been archived by the owner on Aug 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 132
/
og.routing.yml
142 lines (129 loc) · 4.33 KB
/
og.routing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Routes for Organic groups.
og.subscribe:
path: 'group/{entity_type_id}/{group}/subscribe/{og_membership_type}'
defaults:
_controller: '\Drupal\og\Controller\SubscriptionController::subscribe'
_title: 'Join Group'
og_membership_type: default
requirements:
# Only authenticated users can subscribe to group, but we do allow anonymous
# users to reach this route. They will be redirect to login page or be given
# the correct page by the controller.
_access: 'TRUE'
options:
parameters:
group:
type: entity:{entity_type_id}
og.unsubscribe:
path: 'group/{entity_type_id}/{group}/unsubscribe'
defaults:
_controller: '\Drupal\og\Controller\SubscriptionController::unsubscribe'
_title: 'Leave Group'
requirements:
_user_is_logged_in: 'TRUE'
options:
parameters:
group:
type: entity:{entity_type_id}
og.add_multiple_roles_confirm:
path: '/group/roles/add'
defaults:
_form: '\Drupal\og\Form\OgAddMultipleRolesForm'
requirements:
_custom_access: '\Drupal\og\Form\OgAddMultipleRolesForm::access'
og.remove_multiple_roles_confirm:
path: '/group/roles/remove'
defaults:
_form: '\Drupal\og\Form\OgRemoveMultipleRolesForm'
requirements:
_custom_access: '\Drupal\og\Form\OgRemoveMultipleRolesForm::access'
og.entity_autocomplete:
path: '/group/{entity_type_id}/{group}/autocomplete/{target_type}/{selection_handler}/{selection_settings_key}'
defaults:
_controller: '\Drupal\og\Controller\OgAutocompleteController:handleAutocomplete'
requirements:
# @todo This may also require an access check.
_user_is_logged_in: 'TRUE'
options:
parameters:
group:
type: entity:{entity_type_id}
# OG Membership entity routes.
entity.og_membership.add_form:
path: 'group/{entity_type_id}/{group}/admin/members/add/{og_membership_type}'
defaults:
_controller: '\Drupal\og\Controller\OgAdminMembersController::addForm'
_title: 'Add member'
requirements:
_og_membership_add_access: 'TRUE'
options:
_admin_route: 'TRUE'
parameters:
group:
type: entity:{entity_type_id}
# The canonical route is the same as the edit-form route because we need a
# canonical route for various functionality to work properly, but a standard
# entity view for OG memberships tends to feel quite stub-like.
# @todo Implement a route provider for og_membership that subclasses
# \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider::getRoutes().
entity.og_membership.canonical:
path: 'group/{entity_type_id}/{group}/admin/members/{og_membership}/edit'
defaults:
_entity_form: 'og_membership.edit'
options:
_admin_route: 'TRUE'
parameters:
group:
type: entity:{entity_type_id}
requirements:
_entity_access: 'og_membership.edit'
entity.og_membership.edit_form:
path: 'group/{entity_type_id}/{group}/admin/members/{og_membership}/edit'
defaults:
_entity_form: 'og_membership.edit'
options:
_admin_route: 'TRUE'
parameters:
group:
type: entity:{entity_type_id}
requirements:
_entity_access: 'og_membership.edit'
entity.og_membership.delete_form:
path: 'group/{entity_type_id}/{group}/admin/members/{og_membership}/delete'
defaults:
_entity_form: 'og_membership.delete'
options:
_admin_route: 'TRUE'
parameters:
group:
type: entity:{entity_type_id}
requirements:
_entity_access: 'og_membership.delete'
# OG Membership type entity routes.
entity.og_membership_type.collection:
path: '/admin/structure/membership-types'
defaults:
_entity_list: 'og_membership_type'
_title: 'Membership types'
requirements:
_permission: 'administer organic groups'
entity.og_membership_type.edit_form:
path: '/admin/structure/membership-types/manage/{og_membership_type}'
defaults:
_entity_form: 'og_membership_type.edit'
requirements:
_entity_access: 'og_membership_type.update'
entity.og_membership_type.delete_form:
path: '/admin/structure/membership-types/manage/{og_membership_type}/delete'
defaults:
_entity_form: 'og_membership_type.delete'
_title: 'Delete'
requirements:
_entity_access: 'og_membership_type.delete'
og_membership.type_add:
path: '/admin/structure/membership-types/add'
defaults:
_entity_form: 'og_membership_type.add'
_title: 'Add membership type'
requirements:
_permission: 'administer organic groups'