Fine-grained and coarse-grained security