Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class V1Controller extends EApiController
- {
- public function filters()
- {
- // add the filter that will also check for api/signature handshake
- $model = $_GET['model'];
- return array(
- array(
- 'ApiAccessControlFilter -error',
- 'rules'=>array(
- array(
- 'allow',
- 'actions'=>array('list','view'),
- 'roles'=>array("view.{$model}"),
- ),
- array(
- 'allow',
- 'actions'=>array('create'),
- 'roles'=>array("create.{$model}"),
- ),
- array(
- 'allow',
- 'actions'=>array('update'),
- 'roles'=>array("update.{$model}"),
- ),
- array(
- 'allow',
- 'actions'=>array('delete'),
- 'roles'=>array("delete.{$model}"),
- ),
- array(
- 'deny',
- 'users'=>array('*'),
- )
- ),
- )
- );
- }
- public function actionList()
- {
- echo "list page";
- // HHttp::sendHttpResponseCode(203);
- }
- public function actionView()
- {
- $this->renderJson($this->getJsonInputAsArray());
- }
- public function actionCreate()
- {
- $this->renderJson($this->getJsonInputAsArray());
- }
- public function actionUpdate()
- {
- $this->renderJson($this->getJsonInputAsArray());
- }
- public function actionDelete()
- {
- $this->renderJson($this->getJsonInputAsArray());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement