Role permission manager query

Does any one know where the data for role permission manager is stored in the database?
Instead of setting permissions through the UI i want to directly add it to the backend

tabCustom DocPerm

thankyou