c8oSecurity: "You don't have access to this revision of document."

Home Forums Convertigo Products c8oSecurity: "You don't have access to this revision of document."

This topic contains 5 replies, has 3 voices, and was last updated by  Nicolas Albert 4 months, 1 week ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #255795

    Hi,

    I’m trying to access a view in fullsync but i’m stuck with the following error :

    c8oSecurity: “You don’t have access to this revision of document.”

    It seems like I have access to everything else but this document.

    Do you have any idea what’s wrong ?

    Thanks,
    Matthieu

    #255796

    Gregory Vorbe
    Moderator

    Hello Mathieu,

    FS documents can have a security acl (~c8oAcl) or can be bound to a group (c8oGrp).
    The c8oSecurity message occurs when you are trying to access a document that does not belong to you or that is not in your group.
    This should not happen with Views.
    Are you using the Convertigo SDK, a server FS transaction or a Mobile Builder component to access the document?

    QA&Support

    #255797

    Thanks for answering.

    I’m currently using the Convertigo SDK.

    #255798

    Gregory Vorbe
    Moderator

    Could you paste here the sample code that generates the error message, please?
    (this should be the C8O.call…)

    QA&Support

    #255799
    public getStaffByMeetingId(meetingId: string, isLocal: boolean): Observable<{ players: StaffMember[], managers: StaffMember[] }> {
        const params = { key: meetingId };
        return this.fullSync.view(
          FullSyncServicesCsts.STAFF,
          isLocal ? FULL_SYNC_CONFIG.STAFF.VIEW_LOCAL : FULL_SYNC_CONFIG.STAFF.VIEW_AWAY,
          params
        ).pipe(map((data) => {
          return  {
            players: data[0] && data[0].players ? data[0].players.map((player) => {
              return Object.assign(new StaffMember(), player);
            }) : [],
            managers: data[0] && data[0].managers ? data[0].managers.map((manager) => {
              return Object.assign(new StaffMember(), manager);
            }) : []
          };
        }));
      }
    
    public view(config: FullSyncServicesCsts, view: string = FULL_SYNC_CONFIG[config].VIEW_DEFAULT, params: any = {}, live: boolean = false): Observable<any> {
            params = { view, ddoc: FULL_SYNC_CONFIG[config].DDOC, ...params, ...(live ? { __live: view } : {}) };
            this._lives.set(FULL_SYNC_CONFIG[config].DB_NAME, (this._lives.get(FULL_SYNC_CONFIG[config].DB_NAME) || []).concat(params.__live ? [view] : []));
            return Observable.create((observer) => {
                this.getDataState(config, observer).pipe(skipWhile((state) => state !== DataState.LOADED), first()).subscribe(() => {
                    this.c8o.callJsonObject('fs://' + FULL_SYNC_CONFIG[config].DB_NAME + '.view', params).then((data: any) => {
                        console.log('Data ' + FULL_SYNC_CONFIG[config].DB_NAME + '.view : ', params);
                        observer.next(data.rows && data.rows.length > 0 ? data.rows.map((row) => row.value) : []);
                        return null;
                    }).fail((error) => {
                        console.log('Data ' + FULL_SYNC_CONFIG[config].DB_NAME + '.view : loading returned error', params);
                        if (FULL_SYNC_CONFIG[config].ERROR_VIEW_LABEL) {
                            this.message.create(FULL_SYNC_CONFIG[config].ERROR_VIEW_LABEL, 'danger');
                        }
                        observer.error(error);
                    });
                });
            });
        }
    
    #255815

    Nicolas Albert
    Keymaster

    I don’t understand if the message is in the fail or not.
    If it’s the only result of a view or one of the result.
    The question is if the ddoc itself contains the message (in this case, the server ddoc is corrupted by a ~c8oACL attribute to remove).
    Or if one of the documents contains the message (in this case, the authentication was lost during the replication process).

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.