I'm probably going to be working on this same problem soon. I remember in school being taught about unix filesystem permissions. The basic idea there is that any given file or directory has 3 types of permission:
1) owner
2) group
3) everybody else
Additionally, each of those 3 groups has 3 types of permission
1) read
2) write
3) execute
This system works pretty well because As the owner of a file, you can set it to be executable or writeable or whatever. You can also arbitrarily define any new group containing whatever folks you like to have whatever access you like. Lastly, for everyone who you are not specifically interested in, you can assign yet another permission.
Your application permission situation is similar and the concept of owner/group/everyone might be useful for you. What will also be necessary is to uniquely identify everything you might want to apply some permission to. Once you start to run a specific function or method that should have a permission, you can check your database table to find out if the correct permissions exist.
This is by no means a complete discussion of the matter...just some food for thought. It might help to think of your application actions as equivalent to read/write/execute...or it might not.
At any rate, it would probably be helpful to assign some unique ID of some kind ot each of your application's objects that you want to define a permission for.