XF 2.2 ACP Links

Ozzy47

Well-known member
What I need to do is when a addon is installed, change a existing links “Required admin permission” to a different permission. So say for example the link “Alert users” under the communication tab.

What would the best way to change it from user to alertUsers
 
Actually, thinking about it, that might not be the best approach to what I need. That would remove the link for those with the expected permission, and only show it for those with the new permission.

Perhaps it would be better to recreate any existing links, add the new permissions to those links.

Only problem I see with that is there is a potential of having duplicate links showing if I have the old permission and the new one. 🤔
 
TBH, there probably isn't a great way. You probably need to extend XF\AdminNavigation and manipulate how the navigation tree is built. I'm not sure the best approach here, though it probably depends on your implementation details. You could adjust how the list is filtered and apply extra checks or you could theoretically rewrite the permission ID various links check against (by making changes to the entries array).
 
Back
Top Bottom