3 Replies Latest reply: Aug 23, 2011 6:53 AM by Miguel Angel Baeyens de Arce RSS
      • Re: is it possible to show at POC level to restrict a user, that he can see the data related to him?
        Miguel Angel Baeyens de Arce

        Hi,

         

        It's always possible. You only need to use the section access in your document with a reduction field. Check this very simple example of script

         

        SECTION ACCESS;
        
        // Admins, users and their passwords and grants
        // The field for reduction is CONTINENT
        // All fields and values MUST be UPPERCASE
        // If you want ADMIN to see everythin, live blank the value under CONTINENT
        LOAD * INLINE [
        ACCESS, USERID, PASSWORD, CONTINENT
        ADMIN, ADMIN, ADMIN
        USER, EUROUSER, EUR, EUROPE
        USER, AMERUSER, AME, AMERICA
        ];
        
        SECTION APPLICATION;
        
        // Each user above has a correspondence in the CONTINENT field
        // So they will only see COUNTRY values corresponding to their value in CONTINENT
        Data:
        LOAD * INLINE [
        CONTINENT, COUNTRY
        EUROPE, ES
        EUROPE, UK
        AMERICA, US
        AMERICA, PA
        ];
        

         

        Once the script is in place, and before reload it, back it up. go to the Settings menu, Document Properties, Opening and click on "Initial Reduction Based on Section Access".

         

        Once you reload the document, the permissions will be in effect. So from now on, every time you open the document you will be prompted, and depending on the credentials you use, you will see all data (ADMIN) or only the countries to their correspoding users.

         

        It's worth noting that when you open a document wih section access, some reduction takes place, meaning that the records are actually removed from memory, so you will need to reload every time before accessing as a different user or you may be locked out.

         

        Hope that helps.

         

        Miguel Angel Baeyens

        BI Consultant

        Comex Grupo Ibérica