05-10-2017, 11:45 AM
No problem. That permissions in the user table is more about ability to access the site as a whole. I think you're looking for this.....
hasPerm ([permission levels],user’s id)
The venerable, old checkMenu function from the UserCake days was nice, but not really flexible as your number of permission levels grew. So, we have also added hasPerm. If you want something to show up (or not show up) or go through (or fail) based on a person’s permission level, you can now pass in an array.
if (hasPerm([2,103],$user->data()->id)){
//do something
}
You can pass in as many permission levels as you want into that [] array. Permission level ids can be found by going to the Admin dashboard and manage your permission levels. Click on one to get its id. Note that if you don’t make that first argument an array [] , it will throw an error, so use [] even if it is only for one permission level.
hasPerm ([permission levels],user’s id)
The venerable, old checkMenu function from the UserCake days was nice, but not really flexible as your number of permission levels grew. So, we have also added hasPerm. If you want something to show up (or not show up) or go through (or fail) based on a person’s permission level, you can now pass in an array.
if (hasPerm([2,103],$user->data()->id)){
//do something
}
You can pass in as many permission levels as you want into that [] array. Permission level ids can be found by going to the Admin dashboard and manage your permission levels. Click on one to get its id. Note that if you don’t make that first argument an array [] , it will throw an error, so use [] even if it is only for one permission level.