Context-based Access Control and Attack Modelling and Analysis