당신은 현재 사용자가 요청 된 모듈/액션에 액세스 할 수 있습니다 경우 확인하는 필터를 만들 수 있습니다 사용자 클래스에서
if($this->getRequest()->getParameter('module')=='yourmodule' && !$this->getUser()->mayAccess('yourmodule'()){
//redirect to somewhere else
}
을 : 그런
function mayAccess($module){
$key = $module.'_enabled';
if(!$this->hasAttribute($key)){
$enabled = ... //Fetch permission from database
$this->setAttribute($key,$enabled);
}
return $this->getAttribute($key);
}
뭔가. 어쩌면 모듈 security.yml 파일을 사용하고 hasCredential() 메서드와 같은 사용자 자격 증명 및 사용 권한을 검사하는 함수를 재정의 할 수 있습니까? 실제로는 더 깨끗한 방법으로 보입니다.
참조 : http://www.symfony-project.org/api/1_4/sfBasicSecurityUser