added permissions function

permissions function does not work yet