public function update($listener, array $input)
    {
        $all = $this->acl->all();
        if (is_null($all)) {
            return $listener->aclVerificationFailed();
        }
        $roleId = key($input['acl']);

        $role     = $this->foundation->make('antares.role')->query()->where('id', $roleId)->firstOrFail();
        $roleName = $role->name;
        $allowed  = array_keys($input['acl'][$roleId]);

        foreach ($all as $component => $details) {
            $acl     = $this->acl->get($component);
            $actions = $details->actions->get();
            foreach ($actions as $actionId => $name) {
                $allow = in_array($actionId, $allowed);
                $acl->allow($roleName, $name, $allow);
            }
            $acl->save();
        }
        return $listener->updateSucceed($roleId);
    }
public function update($listener, array $input)
    {
        $all = $this->acl->all();
        if (is_null($all)) {
            return $listener->aclVerificationFailed();
        }
        $roleId = key($input['acl']);

        $role     = $this->foundation->make('antares.role')->query()->where('id', $roleId)->firstOrFail();
        $roleName = $role->name;
        $allowed  = array_keys($input['acl'][$roleId]);

        foreach ($all as $component => $details) {
            $acl     = $this->acl->get($component);
            $actions = $details->actions->get();
            foreach ($actions as $actionId => $name) {
                $allow = in_array($actionId, $allowed);
                $acl->allow($roleName, $name, $allow);
            }
            $acl->save();
        }
        return $listener->updateSucceed($roleId);
    }
public function update ( $ listener , array $ input ) { $ all = $ this -> acl -> all ( ) ; if ( is_null ( $ all ) ) { return $ listener -> aclVerificationFailed ( ) ; } $ roleId = key ( $ input [ 'acl' ] ) ; $ role = $ this -> foundation -> make ( 'antares.role' ) -> query ( ) -> where ( 'id' , $ roleId ) -> firstOrFail ( ) ; $ roleName = $ role -> name ; $ allowed = array_keys ( $ input [ 'acl' ] [ $ roleId ] ) ; foreach ( $ all as $ component => $ details ) { $ acl = $ this -> acl -> get ( $ component ) ; $ actions = $ details -> actions -> get ( ) ; foreach ( $ actions as $ actionId => $ name ) { $ allow = in_array ( $ actionId , $ allowed ) ; $ acl -> allow ( $ roleName , $ name , $ allow ) ; } $ acl -> save ( ) ; } return $ listener -> updateSucceed ( $ roleId ) ; }
Update ACL metric.

@param  object  $listener
@param  array   $input

@return mixed
Update ACL metric .