public function isUpdatable(): bool
    {
        if (is_null($this->authorization)) {
            throw new \Exception("Authorization must be set");
        }

        // top dogs can update
        if ($this->authorization->hasTopRole()) {
            return true;
        }

        // non-top dogs can be updated
        if (!$this->hasTopRole()) {
            return true;
        }

        return false;
    }
public function isUpdatable(): bool
    {
        if (is_null($this->authorization)) {
            throw new \Exception("Authorization must be set");
        }

        // top dogs can update
        if ($this->authorization->hasTopRole()) {
            return true;
        }

        // non-top dogs can be updated
        if (!$this->hasTopRole()) {
            return true;
        }

        return false;
    }
public function isUpdatable ( ) : bool { if ( is_null ( $ this -> authorization ) ) { throw new \ Exception ( "Authorization must be set" ) ; } // top dogs can update if ( $ this -> authorization -> hasTopRole ( ) ) { return true ; } // non-top dogs can be updated if ( ! $ this -> hasTopRole ( ) ) { return true ; } return false ; }
whether model is allowed to be updated
do not allow non-owners to edit owners
whether model is allowed to be updated do not allow non - owners to edit owners