I want to modify CRUD permissions for a custom object inside my Visualforce page controller (accessible only by administrators) in order to hide/show this object to other users when clicking on a button.
My goal is to avoid losing time doing it manually especially if there are lots of profiles.
Is there an easy way to do this ?
I know how to check for permissions, but not how to modify them :
if (Schema.sObjectType.MyObject.isAccessible())
{
}
Thanks for your answers.