How to hide, in "Edit Preferences", the categories user's have no access to
When users go to edit their profile they can click on "Edit Preferences" on the left to set their notification preferences.
Then under "Category Notifications" the list of categories displayed includes categories they have no access rights (these categories have specific role-based access).
While I consider this somewhat of a bug (any advise how to report bugs?) the immediate question is how to remove from the list the categories the user does not have access rights to.
Best Answers
-
peregrine MVP
While I consider this somewhat of a bug (any advise how to report bugs?)
ok. will go through it just one more time
here are some basic thoughts
1) check github to see if issue or pull request exists or has been mentioned on forum. All depends on your sleuthing skills if you can find one that exists that matches the one you experience.
if no match found....
2) file perceived bugs on github
- this requires an account and then click on issues. (this partially satisfies the people including the product manager and the vanilla staff of an issue).
- an issue that is not considered a "security" flaw has little chance of being backported.
- better yet if you have a code fix, file a pull request.3) mention on the forum as well (you may get some thoughts how to work around issue. Generally the forum is directed more to the community, while githu is more directed to the developers.
4) if possible mention the discussion link in the github issue description.
5) mention the github link in the discussion.
the immediate question is how to remove from the list the categories
you may not get an immediate answer, but you can research yourself in a flash...
fwiw - IIRC this is not an issue in vanilla 2.2 (someone else can confirm)
perhaps...
as far as 2.1 you can use eventi plugin to determine the event to trigger on and see what you can do to remove preferences or override view if you have to.
BeforePreferencesRender
or totally override notificationpreferences.php
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
1 -
peregrine MVP
As for Eventi I tried that once and it overwhelemed my screen.
it's a vanilla developers best friend.
you are barking around the wrong tree fooling around in a live environment.
If you want to be the sharpest hat around.....
you should develop and test in a test environment.
get the tophats to give you an old pc, load up ubuntu, and sql, apache,and php.
add vanilla, and voilla.then you will have an environment to test in.
or create a test forum on your current web server.
I've already provided you with the two most important links on the forum
(the adept link and the faq), thats all you needI may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
5 -
peregrine MVP
BTW, as far as I can tell with my test, if a member doesn't have permission to view a category under custom categories. That category is not shown. nor is it displayed in the notifications. So one would have to analyze your category setup ans see if your permissions are set up the way you think they are.
But without scrrenshots of your custom permissions, roles, categories, and notification preferences under a specific role, it would be hard to tell.
So, as far as I can see it is not a bug.
the code is as follows from class hooks.
foreach (CategoryModel::categories() as $Category) { if (!$Category['PermsDiscussionsView'] || $Category['Depth'] <= 0 || $Category['Depth'] > 2 || $Category['Archived']) { continue; } $Category['Heading'] = ($DoHeadings && $Category['Depth'] <= 1); $Categories[] = $Category; if ($PostBack) { foreach ($Prefixes as $Prefix) { $FieldName = "$Prefix.{$Category['CategoryID']}"; $Value = $Sender->Form->getFormValue($FieldName, null); if (!$Value) { $Value = null; } $Set[$FieldName] = $Value; } } } $Sender->setData('CategoryNotifications', $Categories);
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
5
Answers
ok. will go through it just one more time
here are some basic thoughts
1) check github to see if issue or pull request exists or has been mentioned on forum. All depends on your sleuthing skills if you can find one that exists that matches the one you experience.
if no match found....
2) file perceived bugs on github
- this requires an account and then click on issues. (this partially satisfies the people including the product manager and the vanilla staff of an issue).
- an issue that is not considered a "security" flaw has little chance of being backported.
- better yet if you have a code fix, file a pull request.
3) mention on the forum as well (you may get some thoughts how to work around issue. Generally the forum is directed more to the community, while githu is more directed to the developers.
4) if possible mention the discussion link in the github issue description.
5) mention the github link in the discussion.
you may not get an immediate answer, but you can research yourself in a flash...
fwiw - IIRC this is not an issue in vanilla 2.2 (someone else can confirm)
perhaps...
as far as 2.1 you can use eventi plugin to determine the event to trigger on and see what you can do to remove preferences or override view if you have to.
BeforePreferencesRender
or totally override notificationpreferences.php
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Thanks for the very detailed response. If this is addressed in another release then I won't file a bug report.
I will check Eventi again. Last I tried that it overwhelmed my screen.
it's a vanilla developers best friend.
you are barking around the wrong tree fooling around in a live environment.
If you want to be the sharpest hat around.....
you should develop and test in a test environment.
get the tophats to give you an old pc, load up ubuntu, and sql, apache,and php.
add vanilla, and voilla.
then you will have an environment to test in.
or create a test forum on your current web server.
I've already provided you with the two most important links on the forum
(the adept link and the faq), thats all you need
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
BTW, as far as I can tell with my test, if a member doesn't have permission to view a category under custom categories. That category is not shown. nor is it displayed in the notifications. So one would have to analyze your category setup ans see if your permissions are set up the way you think they are.
But without scrrenshots of your custom permissions, roles, categories, and notification preferences under a specific role, it would be hard to tell.
So, as far as I can see it is not a bug.
the code is as follows from class hooks.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.