i have table titled gorups
have
posting enum(‘yes’,’no’)
delete enum(‘yes’,’no’)
in the gorups table
how i can make Permission system in php
this mean
when write
if(Permis['posting']=='yes'){
echo ok;
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming your are using MySQL, why not use BOOLEAN or the equivalent TINYINT(1) instead of ENUM? There is no reason to use strings ‘yes’ and ‘no’ when they are really booleans true and false.
Stuff like that can be handled through an ACL. One implementation of an ACL in PHP is Zend_Acl. If you do not want to use an ACL but just your database and your own code, you would have to write some code that queries your database for the permission of the Group, e.g.
SELECT posting from Groups where id = [groupId].