Implement Permissions checks into Core

I may have missed some spots...
Python throws a fit if we try to modify perm directly, so to work around that I made a second variable (permission) to take perm's value and modify it as we needed.