changed get_permission for flags only