Defining permissions programmatically