Added permission checking before actions.