You need to write that logic in your custom section code when you create it.

In order to maintain a consistent UI layout it may be better to disable specific buttons depending on who has logged in and what their roles are. The userRoles() function can be used to get the roles of the logged in user then adjust the UI behavior accordingly in your custom section.