Yii Framework Forum

user permission or user privellege


(fahli prasetyo) #1

i have cases in my project, i dont know use and fix. so, i want disabled and hide submit button that clear. but problem come to me, when i use link /create it can. how to fix i need your opinion or argument. i have 2 role admin and customer.

in admin can index, create, view, update and delete

and

customer cannot create and delete, but customer can index, view, and update

please help me


How to use scenario of an CActiveRecord
(Alexander Makarov) #2

Sounds like RBAC. Check the guide on it.


(Vanxcode) #3

Simple way, you can use AccessControl with roles then set Condition on MatchCallback .


(GerardFelix) #4
function sendData(){

  jQuery("#submit").attr("disabled","disabled");

  jQuery.ajax({
     // ajax options.. 
  });
} // function block