A Logic-Based Approach for Enforcing Access Control