Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] Control access to component preferences individually #41496

Open
wants to merge 36 commits into
base: 5.3-dev
Choose a base branch
from
Open
Changes from 16 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8a9f9fe
Update ExceptionHandler.php
MarkRS-UK Jun 27, 2022
298dae1
Merge pull request #1 from MarkRS-UK/MarkRS-UK-patch-1
MarkRS-UK Jun 27, 2022
0e86915
Merge branch '4.2-dev' into master
HLeithner Jun 27, 2022
7e1e53d
Merge branch '4.2-dev' into master
laoneo Jun 27, 2022
a2a04e5
Merge branch '4.2-dev' into master
richard67 Jun 28, 2022
5f35fd7
Merge branch 'joomla:4.2-dev' into master
MarkRS-UK Jul 18, 2022
3de0665
Merge branch 'joomla:4.3-dev' into master
MarkRS-UK Jun 14, 2023
2db4c95
Merge branch 'joomla:4.3-dev' into master
MarkRS-UK Aug 28, 2023
0b07115
Update HtmlView.php
MarkRS-UK Aug 28, 2023
15d1f74
Update HtmlView.php
MarkRS-UK Aug 28, 2023
3728966
Merge branch '4.3-dev' into preferences
MarkRS-UK Aug 28, 2023
188e6e4
Update administrator/components/com_config/src/View/Component/HtmlVie…
MarkRS-UK Aug 28, 2023
f75609e
Update administrator/components/com_config/src/View/Component/HtmlVie…
MarkRS-UK Aug 28, 2023
e41f642
Update administrator/components/com_config/src/View/Component/HtmlVie…
MarkRS-UK Aug 28, 2023
ef6dead
Update administrator/components/com_config/src/View/Component/HtmlVie…
MarkRS-UK Aug 28, 2023
757dbdc
Update administrator/components/com_config/src/View/Component/HtmlVie…
MarkRS-UK Aug 28, 2023
ddef3a8
Update administrator/components/com_config/src/View/Component/HtmlVie…
MarkRS-UK Aug 28, 2023
2c03800
Update administrator/components/com_config/src/View/Component/HtmlVie…
MarkRS-UK Aug 29, 2023
2bd57d4
Merge branch '4.3-dev' into preferences
MarkRS-UK Aug 29, 2023
7285ec2
Update ComponentModel.php
MarkRS-UK Aug 29, 2023
a0fd5ec
Update ComponentModel.php
MarkRS-UK Aug 29, 2023
3b378ad
Merge remote-tracking branch 'upstream/5.0-dev' into preferences
richard67 Aug 31, 2023
b97d43d
Merge branch '5.0-dev' into preferences
richard67 Sep 1, 2023
2fe9b18
Update administrator/components/com_config/src/View/Component/HtmlVie…
MarkRS-UK Sep 4, 2023
160f98b
Merge branch '5.0-dev' into preferences
QuyTon Sep 5, 2023
e9a2a63
Merge branch '5.0-dev' into preferences
MarkRS-UK Sep 6, 2023
972f437
Merge branch '5.0-dev' into preferences
MarkRS-UK Sep 6, 2023
0a2ac30
Merge branch '5.0-dev' into preferences
MarkRS-UK Sep 7, 2023
aa88a61
Merge branch '5.0-dev' into preferences
MarkRS-UK Sep 7, 2023
aec2e0f
Merge branch '5.0-dev' into preferences
MarkRS-UK Sep 7, 2023
76511b4
Merge branch '5.0-dev' into preferences
MarkRS-UK Sep 10, 2023
746b6e4
Merge branch '5.0-dev' into preferences
MarkRS-UK Sep 11, 2023
d7f0613
Merge branch '5.0-dev' into preferences
MarkRS-UK Sep 11, 2023
debb756
Merge branch '5.2-dev' into preferences
MarkRS-UK Apr 27, 2024
f4001e0
Merge branch '5.3-dev' into preferences
richard67 Sep 15, 2024
e9adbe5
Fix PHPCS
richard67 Sep 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,18 @@ public function display($tpl = null)
$this->fieldsets = $form ? $form->getFieldsets() : null;
$this->formControl = $form ? $form->getFormControl() : null;

// Don't show permissions fieldset if not authorised.
if (!$user->authorise('core.admin', $component->option) && isset($this->fieldsets['permissions'])) {
unset($this->fieldsets['permissions']);
// Remove unauthorised preference tabs.
foreach($this->fieldsets as $key => $value) {
MarkRS-UK marked this conversation as resolved.
Show resolved Hide resolved
if ($key == 'permissions') {
MarkRS-UK marked this conversation as resolved.
Show resolved Hide resolved
if ((!$user->authorise('core.admin', $component->option) || !$user->authorise('core.options.permission', $component->option))
&& isset($this->fieldsets['permissions'])) {
MarkRS-UK marked this conversation as resolved.
Show resolved Hide resolved
unset($this->fieldsets['permissions']);
}
} else {
if (!$user->authorise("core.options.$key", $component->option) && isset($this->fieldsets[$key])) {
unset($this->fieldsets[$key]);
}
}
}

$this->form = &$form;
Expand Down