protected function parseAlias()
    {
        if ( $alias = $this->getAction('protect_alias') ) {
            return $alias;
        }

        $action = $this->request->route()->getActionName();

        $ctrl = preg_match('/([^@]+)+/is', $action, $m) ? $m[1] : $action;
        $name = last(explode('\\', $ctrl));
        $name = str_replace('controller', '', strtolower($name));
        $name = str_singular($name);

        return $name;
    }
protected function parseAlias()
    {
        if ( $alias = $this->getAction('protect_alias') ) {
            return $alias;
        }

        $action = $this->request->route()->getActionName();

        $ctrl = preg_match('/([^@]+)+/is', $action, $m) ? $m[1] : $action;
        $name = last(explode('\\', $ctrl));
        $name = str_replace('controller', '', strtolower($name));
        $name = str_singular($name);

        return $name;
    }
protected function parseAlias ( ) { if ( $ alias = $ this -> getAction ( 'protect_alias' ) ) { return $ alias ; } $ action = $ this -> request -> route ( ) -> getActionName ( ) ; $ ctrl = preg_match ( '/([^@]+)+/is' , $ action , $ m ) ? $ m [ 1 ] : $ action ; $ name = last ( explode ( '\\' , $ ctrl ) ) ; $ name = str_replace ( 'controller' , '' , strtolower ( $ name ) ) ; $ name = str_singular ( $ name ) ; return $ name ; }
Extract controller name, make it singular
to match it with model name to be able
to match against permissions view.user,
create.user etc.

@return string
Extract controller name make it singular to match it with model name to be able to match against permissions view . user create . user etc .