You can put a hierarchy of Roles in a database, but the actual role check can (and I think should) be hard-coded.
In your API you might have a method "public void NewProduct()" That individual method should have the ProductWrite permission (role), and you can give that permission to higher level "containers" or "roles". So Admin has ProductWrite, and ContentManager might also have ProductWrite. In your code it's just one check has("ProductWrite").
Does that make sense?