Skip to content

Commit

Permalink
Closes #2302 - Adds Permissions to Users
Browse files Browse the repository at this point in the history
            - Extends LDAP client to read permission attributes from users
            - Extends database schema with PERMISSION_INFO table and sets schema version to 6.4.0
            - Exetends User models (Builder, Mapper,..) to have permission attribute
    	- Determination of Domains is now able to be done via permissions defined on users

    Signed-off-by: Kálmán Képes <[email protected]>
  • Loading branch information
nyuuyn authored and ryzheboka committed Sep 28, 2023
1 parent 8cff46a commit 18c34d1
Show file tree
Hide file tree
Showing 39 changed files with 566 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ DELETE FROM OBJECT_REFERENCE;
DELETE FROM SCHEDULED_JOB;
DELETE FROM USER_INFO;
DELETE FROM GROUP_INFO;
DELETE FROM PERMISSION_INFO;
INSERT INTO CONFIGURATION (NAME) VALUES ('MASTER');
COMMIT;
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ DROP TABLE OBJECT_REFERENCE;
DROP TABLE SCHEDULED_JOB;
DROP TABLE USER_INFO;
DROP TABLE GROUP_INFO;
DROP TABLE PERMISSION_INFO;
DROP SEQUENCE SCHEDULED_JOB_SEQ;
DROP SEQUENCE TASKANA_SCHEMA_VERSION_ID_SEQ;
COMMIT;
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,13 @@ CREATE TABLE GROUP_INFO
PRIMARY KEY (USER_ID, GROUP_ID)
);

CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR(32) NOT NUll,
PERMISSION_ID VARCHAR(256) NOT NULL,
PRIMARY KEY (USER_ID, PERMISSION_ID)
);

CREATE SEQUENCE SCHEDULED_JOB_SEQ
MINVALUE 1
START WITH 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- this script updates the TASKANA database schema from version 6.2.0 to version 6.4.0.
SET SCHEMA %schemaName%;

INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '6.4.0', CURRENT_TIMESTAMP);

CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR(32) NOT NULL,
PERMISSION_ID VARCHAR(256) NOT NULL,
PRIMARY KEY (USER_ID, PERMISSION_ID)
);
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,13 @@ CREATE TABLE GROUP_INFO
PRIMARY KEY (USER_ID, GROUP_ID)
);

CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR(32) NOT NULL,
PERMISSION_ID VARCHAR(256) NOT NULL,
PRIMARY KEY (USER_ID, PERMISSION_ID)
);

CREATE SEQUENCE SCHEDULED_JOB_SEQ
MINVALUE 1
START WITH 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- this script updates the TASKANA database schema from version 6.2.0 to version 6.4.0.

INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '6.4.0', CURRENT_TIMESTAMP);

CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR(32) NOT NULL,
PERMISSION_ID VARCHAR(256) NOT NULL,
PRIMARY KEY (USER_ID, PERMISSION_ID)
);
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,13 @@ CREATE TABLE GROUP_INFO
CONSTRAINT GROUP_INFO_PKEY PRIMARY KEY (USER_ID, GROUP_ID)
);

CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR2(32) NOT NULL,
PERMISSION_ID VARCHAR2(256) NOT NULL,
CONSTRAINT PERMISSION_INFO_PKEY PRIMARY KEY (USER_ID, PERMISSION_ID)
);

CREATE SEQUENCE SCHEDULED_JOB_SEQ
START WITH 1
INCREMENT BY 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- this script updates the TASKANA database schema from version 6.2.0 to version 6.4.0.
ALTER SESSION SET CURRENT_SCHEMA = %schemaName%;

INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '6.4.0', CURRENT_TIMESTAMP);

CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR2(32) NOT NULL,
PERMISSION_ID VARCHAR2(256) NOT NULL,
CONSTRAINT PERMISSION_INFO_PKEY PRIMARY KEY (USER_ID, PERMISSION_ID)
);
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,13 @@ CREATE TABLE GROUP_INFO
PRIMARY KEY (USER_ID, GROUP_ID)
);

CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR(32) NOT NULL,
PERMISSION_ID VARCHAR(256) NOT NULL,
PRIMARY KEY (USER_ID, PERMISSION_ID)
);

CREATE SEQUENCE SCHEDULED_JOB_SEQ
MINVALUE 1
START WITH 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- this script updates the TASKANA database schema from version 6.2.0 to version 6.4.0.

SET search_path = %schemaName%;

INSERT INTO TASKANA_SCHEMA_VERSION (ID, VERSION, CREATED)
VALUES (nextval('TASKANA_SCHEMA_VERSION_ID_SEQ'), '6.4.0', CURRENT_TIMESTAMP);

CREATE TABLE PERMISSION_INFO
(
USER_ID VARCHAR(32) NOT NULL,
PERMISSION_ID VARCHAR(256) NOT NULL,
PRIMARY KEY (USER_ID, PERMISSION_ID)
);
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ taskana.ldap.userOrglevel3Attribute=someDepartement
taskana.ldap.userOrglevel4Attribute=orgLevel4
taskana.ldap.userIdAttribute=uid
taskana.ldap.userMemberOfGroupAttribute=memberOf
taskana.ldap.userPermissionsAttribute=permission
taskana.ldap.groupSearchBase=cn=groups
taskana.ldap.groupSearchFilterName=objectclass
taskana.ldap.groupSearchFilterValue=groupOfUniqueNames
Expand Down
Loading

0 comments on commit 18c34d1

Please sign in to comment.