Enable passing of function for tab permissions

Instead of only accepting a string, we can now pass a lambda or function to the permissions check to enable more custom restrictions.