Merge "Correct a permission check / add a test" am: 05cf3e896c am: 04be13bb01

Change-Id: I88b7d0c0dfa563debe1dda88649d7fb0f43155df