Skip to content

Commit 0eb60fb

Browse files
authored
fix(profile): standardize simcard rights label (#21978)
1 parent a567510 commit 0eb60fb

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

src/DeviceSimcard.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,4 @@ public static function getIcon()
113113
{
114114
return "ti ti-device-sim";
115115
}
116-
117-
public function getRights($interface = 'central')
118-
{
119-
$rights = parent::getRights($interface);
120-
// Update labels to match other assets
121-
$rights[READ] = __('View all');
122-
$rights[UPDATE] = __('Update all');
123-
return $rights;
124-
}
125116
}

src/Item_DeviceSimcard.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,16 @@ public function getImportCriteria(): array
191191
'msin' => 'equal',
192192
];
193193
}
194+
195+
public function getRights($interface = 'central')
196+
{
197+
$rights = parent::getRights($interface);
198+
// Update labels to match other assets
199+
$rights[READ] = __('View all');
200+
$rights[UPDATE] = __('Update all');
201+
unset($rights[CREATE]);
202+
unset($rights[DELETE]);
203+
unset($rights[PURGE]);
204+
return $rights;
205+
}
194206
}

src/Profile.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -896,13 +896,9 @@ public static function getRightsForForm(string $interface = 'all', string $form
896896
$fn_get_rights(NetworkName::class, 'central', [
897897
'label' => __('Internet'),
898898
]),
899-
$fn_get_rights(DeviceSimcard::class, 'central', [
899+
$fn_get_rights(Item_DeviceSimcard::class, 'central', [
900900
'label' => __('Simcard PIN/PUK'),
901901
'field' => 'devicesimcard_pinpuk',
902-
'rights' => [
903-
READ => __('Read'),
904-
UPDATE => __('Update'),
905-
],
906902
]),
907903
],
908904
],

0 commit comments

Comments
 (0)