Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1168616
D52.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Sep 25, 2:15 AM
Size
2 KB
Mime Type
text/x-diff
Expires
Fri, Sep 26, 2:15 AM (11 h, 5 m)
Engine
blob
Format
Raw Data
Handle
757050
Attached To
D52: INP-1414 - Remove "perm_prefix" processing code duplication in "perm" unit
D52.diff
View Options
Index: branches/5.2.x/core/units/permissions/permissions_event_handler.php
===================================================================
--- branches/5.2.x/core/units/permissions/permissions_event_handler.php
+++ branches/5.2.x/core/units/permissions/permissions_event_handler.php
@@ -140,12 +140,7 @@
/* @var $sections_helper kSectionsHelper */
foreach ($permissions as $section_name => $section_permissions) {
- $section_data =& $sections_helper->getSectionData($section_name);
-
- if ( $section_data && isset($section_data['perm_prefix']) ) {
- // using permission from other prefix
- $section_name = $this->Application->getUnitOption($section_data['perm_prefix'] . '.main', 'PermSection');
- }
+ $section_name = $sections_helper->getPermSection($section_name);
foreach ($section_permissions as $perm_name => $perm_value) {
if ( !$permissions_helper->isOldPermission($section_name, $perm_name) ) {
@@ -263,4 +258,4 @@
}
}
-}
\ No newline at end of file
+}
Index: branches/5.2.x/core/units/permissions/permissions_tag_processor.php
===================================================================
--- branches/5.2.x/core/units/permissions/permissions_tag_processor.php
+++ branches/5.2.x/core/units/permissions/permissions_tag_processor.php
@@ -55,12 +55,7 @@
$sections_helper = $this->Application->recallObject('SectionsHelper');
/* @var $sections_helper kSectionsHelper */
- $section_data =& $sections_helper->getSectionData($section_name);
-
- if ($section_data && isset($section_data['perm_prefix'])) {
- // using permission from other prefix
- $section_name = $this->Application->getUnitOption($section_data['perm_prefix'].'.main', 'PermSection');
- }
+ $section_name = $sections_helper->getPermSection($section_name);
$permissions_helper = $this->Application->recallObject('PermissionsHelper');
/* @var $permissions_helper kPermissionsHelper */
@@ -228,4 +223,4 @@
return $this->Prefix.'['.$this->Application->GetVar('group_id').']['.$this->Application->Parser->GetParam('PermissionName').']['.$params['sub_key'].']';
}
- }
\ No newline at end of file
+ }
Event Timeline
Log In to Comment