@@ 128-141 (lines=14) @@ | ||
125 | // Determine inherited assignments |
|
126 | if ($record instanceof Group) { |
|
127 | // Get all permissions from roles |
|
128 | if ($record->Roles()->count()) { |
|
129 | foreach ($record->Roles() as $role) { |
|
130 | /** @var PermissionRole $role */ |
|
131 | foreach ($role->Codes() as $code) { |
|
132 | if (!isset($inheritedCodes[$code->Code])) { |
|
133 | $inheritedCodes[$code->Code] = array(); |
|
134 | } |
|
135 | $inheritedCodes[$code->Code][] = _t( |
|
136 | 'SilverStripe\\Security\\PermissionCheckboxSetField.FromRole', |
|
137 | 'inherited from role "{title}"', |
|
138 | 'A permission inherited from a certain permission role', |
|
139 | array('title' => $role->dbObject('Title')->forTemplate()) |
|
140 | ); |
|
141 | } |
|
142 | } |
|
143 | } |
|
144 | ||
@@ 153-163 (lines=11) @@ | ||
150 | continue; |
|
151 | } |
|
152 | foreach ($parent->Roles() as $role) { |
|
153 | if ($role->Codes()) { |
|
154 | foreach ($role->Codes() as $code) { |
|
155 | if (!isset($inheritedCodes[$code->Code])) { |
|
156 | $inheritedCodes[$code->Code] = array(); |
|
157 | } |
|
158 | $inheritedCodes[$code->Code][] = _t( |
|
159 | 'SilverStripe\\Security\\PermissionCheckboxSetField.FromRoleOnGroup', |
|
160 | 'inherited from role "%s" on group "%s"', |
|
161 | 'A permission inherited from a role on a certain group', |
|
162 | array('roletitle' => $role->dbObject('Title')->forTemplate(), 'grouptitle' => $parent->dbObject('Title')->forTemplate()) |
|
163 | ); |
|
164 | } |
|
165 | } |
|
166 | } |
|
@@ 167-180 (lines=14) @@ | ||
164 | } |
|
165 | } |
|
166 | } |
|
167 | if ($parent->Permissions()->Count()) { |
|
168 | foreach ($parent->Permissions() as $permission) { |
|
169 | if (!isset($inheritedCodes[$permission->Code])) { |
|
170 | $inheritedCodes[$permission->Code] = array(); |
|
171 | } |
|
172 | $inheritedCodes[$permission->Code][] = |
|
173 | _t( |
|
174 | 'SilverStripe\\Security\\PermissionCheckboxSetField.FromGroup', |
|
175 | 'inherited from group "{title}"', |
|
176 | 'A permission inherited from a certain group', |
|
177 | array('title' => $parent->dbObject('Title')->forTemplate()) |
|
178 | ); |
|
179 | } |
|
180 | } |
|
181 | } |
|
182 | } |
|
183 | } |