I have this user interface where the user can batch edit/add/delete Test Types and their weights related to a subject/schooclass combination.
Each test type belongs to a test.
There are actions on buttons which should not always be possible to execute due to business logic coming from the backend like:
Editing a test type and changing the weight should not be possible if the the related test(s) has already pupils with scores/grades assigned.
Deleting a test type should not be possible when this test type has already been assigned to an existing test
As the user can not do anything within that test types view to change the button states I would not disable the edit/delete buttons, but I would hide them.
Question Where is the advantage for the user to hide those buttons or let the user click those buttons but get an error notification in return like:
"You are not allowed to change the weight of a test(s) when the pupils already took the test!"
"You can not delete this test type because it is already assigned to one or many other tests which can not be deleted either else you might loose the pupils grade/scores!"
UPDATE
I am following the option now to disable the buttons. As I support desktop/mobile clients a tooltip will not work.
Therefore I have this mockup prepared as solution. I hope you like it if not please let me know :-)