Skip to main content
Question

Document access levels in Project Access and Document Management


Show first post

28 replies

Forum|alt.badge.img+4
  • Do Gooder (Partner)
  • 16 replies
  • May 22, 2024

Hi All, 

 

I went throught most of the commentaries on this post, but I just want to confirm something : 

If we add tody a user_group to a specific document_access  with the view access,  the users within this group won’t see any document from the specific document_class that were published before today right ? 

How is it possible to give view access to all items of a specific document_class to  people we have just given this view access ?  

 

Best regards,


Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • 2840 replies
  • May 23, 2024
baptiste.herve wrote:

 

If we add tody a user_group to a specific document_access  with the view access,  the users within this group won’t see any document from the specific document_class that were published before today right ? 

Correct. Adding new access lines to the access *template* will not update the access to any existing documents.

baptiste.herve wrote:

How is it possible to give view access to all items of a specific document_class to  people we have just given this view access ?  

There's no feature to propagate the contents of the access template to existing documents today.

A way to be proactive about this is to never add specific persons to the access template, always use groups. Then you can easily add or remove access lines for those groups.

If you need to change the access to existing documents you need to update their access definition one by one, or write a script or use data migration to update them in bulk. A custom event can also do it.

Good luck!


Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • 2840 replies
  • May 24, 2024

Here is a simple custom event action that will push one ONE document access template line, when it is updated:

DECLARE 
   doc_class_ VARCHAR2(100) := '&NEW:DOC_CLASS';
   CURSOR get_docs IS
      SELECT doc_no, doc_sheet, doc_rev
      FROM doc_issue_tab
      WHERE doc_class = doc_class_;
BEGIN
   FOR doc_ IN get_docs LOOP
      BEGIN
         Document_Issue_Access_API.Insert_Access(
            doc_class_, doc_.doc_no, doc_.doc_sheet, doc_.doc_rev,
            '&NEW:PERSON_ID', '&NEW:GROUP_ID', 1, &NEW:ADMIN_ACCESS, &NEW:EDIT_ACCESS, &NEW:VIEW_ACCESS, 'Pushed from template');
      EXCEPTION
         WHEN others THEN
           NULL;
      END;
   END LOOP;
END;

It relies on a custom event on the DocumentAccessTemplate entity, which fires when a row is updated and when the Note field is set to "push". That's how I did it, but it can be done in many other ways. It's a quite naive solution, but it works. If the person or group to be pushed already has access, there will be an exception which we ignore.

So, you need to add the new access line first, then save, then edit it and set Note to “push”. The code above should work even without that condition though.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings