DS6 Database Question - "resourcepolicy" table

148 views
Skip to first unread message

John Fitzgerald

unread,
Jul 27, 2022, 2:28:03 PM7/27/22
to DSpace Technical Support
Howdy, 

Would someone please clue me in on what the "action_id" field in the "resourcepolicy" table  is plugged into? I see no descriptive reference to it in any other tables. 

I'm trying to write some SQL-scripts to audit permissions on a large repository.

Thanks,
-John

Sean Kalynuk

unread,
Jul 27, 2022, 2:43:04 PM7/27/22
to John Fitzgerald, DSpace Technical Support

Hi John,

 

Some more info here:

 

https://wiki.lyrasis.org/display/DSDOC6x/Functional+Overview#FunctionalOverview-Authorization

 

Here’s a SQL case snippet you may find useful from one of my scripts:

 

case

    when action_id=0  then 'READ'

    when action_id=1  then 'WRITE'

    when action_id=2  then 'DELETE'

    when action_id=3  then 'ADD'

    when action_id=4  then 'REMOVE'

    when action_id=5  then 'WORKFLOW_STEP_1'

    when action_id=6  then 'WORKFLOW_STEP_2'

    when action_id=7  then 'WORKFLOW_STEP_3'

    when action_id=8  then 'WORKFLOW_ABORT'

    when action_id=9  then 'DEFAULT_BITSTREAM_READ'

    when action_id=10 then 'DEFAULT_ITEM_READ'

    when action_id=11 then 'ADMIN'

    when action_id=12 then 'WITHDRAWN_READ'

    else 'UNKNOWN'

end

 

Action constants are defined in this source file:

 

https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-api/src/main/java/org/dspace/core/Constants.java

 

--

Sean

 

From: dspac...@googlegroups.com <dspac...@googlegroups.com> on behalf of John Fitzgerald <iph...@gmail.com>
Date: Wednesday, July 27, 2022 at 1:28 PM
To: DSpace Technical Support <dspac...@googlegroups.com>
Subject: [dspace-tech] DS6 Database Question - "resourcepolicy" table

Caution: This message was sent from outside the University of Manitoba.

--
All messages to this mailing list should adhere to the Code of Conduct: https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/5ba40dcc-e3a4-4218-809d-d88f2c1ff3a8n%40googlegroups.com.

John Fitzgerald

unread,
Jul 27, 2022, 2:46:30 PM7/27/22
to DSpace Technical Support
Hey Sean!

Thank you for such a quick and useful response. I figured these keys were hiding somewhere in the source-code, but wasn't anxious to go digging.

This is perfect! And thanks also for the extra info. 

-John

John Fitzgerald

unread,
Jul 27, 2022, 8:33:08 PM7/27/22
to DSpace Technical Support
For my use, I ended up adding a table to the DB (posted here for future-reference), thanks again:

CREATE TABLE public."action" (
    action_id int4 NULL,
    verb varchar(50) NULL
);
INSERT INTO public."action" (action_id,verb) VALUES
     (0,'READ'),
     (1,'WRITE'),
     (2,'DELETE'),
     (3,'ADD'),
     (4,'REMOVE'),
     (5,'WORKFLOW_STEP_1'),
     (6,'WORKFLOW_STEP_2'),
     (7,'WORKFLOW_STEP_3'),
     (8,'WORKFLOW_ABORT'),
     (9,'DEFAULT_BITSTREAM_READ'),
     (10,'DEFAULT_ITEM_READ'),
     (11,'ADMIN'),
     (12,'WITHDRAWN_READ');

Reply all
Reply to author
Forward
0 new messages