An "Aha!" moment with "can" and "is"
Posted: October 27th, 2010, 10:51 am
I was reading somewhere in the "Advanced Conditionals" tab in the s2 documentation and had an "Aha!" moment when I realized the difference between "current_user_is" and "current_user_can."
I don't know how many other folks are beginners like me with coding and recognizing function names and capabilities, so I thought to post it here as a "sharing" moment with other beginners. These two points are probably only a starting point, but hopefully it will help another newbie type folk.
"is" is restrictive. It is only for that which is specified. In s2, this usually means a member can only access the material at the specified level and none other.
"can" is inclusive. It includes all that which it gives permissions for. In s2, this usually means a member can access the specified level and all lesser levels.
Cheers and bright days.
I don't know how many other folks are beginners like me with coding and recognizing function names and capabilities, so I thought to post it here as a "sharing" moment with other beginners. These two points are probably only a starting point, but hopefully it will help another newbie type folk.
"is" is restrictive. It is only for that which is specified. In s2, this usually means a member can only access the material at the specified level and none other.
"can" is inclusive. It includes all that which it gives permissions for. In s2, this usually means a member can access the specified level and all lesser levels.
Cheers and bright days.