Comments (1)
Issue fixed in commit 0b9151d
Migration script to upgrade previous version of ListOf:
/*Create table password*/
CREATE TABLE base.sys_password (
id SERIAL PRIMARY KEY
, "password" TEXT NOT NULL
, user_id INTEGER NOT NULL UNIQUE REFERENCES base.sys_user(id)
, created_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
, updated_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
, created_by_id INTEGER DEFAULT base.get_current_user_id() REFERENCES base.sys_user(id)
, updated_by_id INTEGER DEFAULT base.get_current_user_id() REFERENCES base.sys_user(id)
);
COMMENT ON TABLE base.sys_password IS
'Users password information.';
/*Recreate function to authenticate users*/
CREATE OR REPLACE FUNCTION base.authenticate_user(user_email TEXT, user_password TEXT)
RETURNS base.sys_token AS $$
DECLARE
user_account RECORD;
BEGIN
SELECT a.id, a.email, b.password
INTO user_account
FROM base.sys_user a
INNER JOIN base.sys_password b on a.id=b.user_id
WHERE a.email = user_email
AND flag_active = true;
IF user_account.password = crypt(user_password, user_account.password) THEN
RETURN (
user_account.email, --email
'user_' || user_account.id, --role
'postgraphile' --audience
)::base.sys_token;
ELSE
RETURN NULL;
END IF;
END;
$$ language plpgsql strict security definer;
/*Migrate password from user table to password table*/
INSERT INTO base.sys_password (user_id, password)
SELECT id, password FROM base.sys_user;
/*Triggers on insert*/
CREATE TRIGGER password_create_hash_password BEFORE INSERT
ON base.sys_password FOR EACH ROW EXECUTE PROCEDURE
base.hash_password();
/*Triggers on update*/
CREATE TRIGGER password_update_hash_password BEFORE UPDATE
ON base.sys_password FOR EACH ROW EXECUTE PROCEDURE
base.hash_password();
CREATE TRIGGER password_update_updated_date BEFORE UPDATE
ON base.sys_password FOR EACH ROW EXECUTE PROCEDURE
base.update_updated_date();
CREATE TRIGGER password_update_updated_by_id BEFORE UPDATE
ON base.sys_password FOR EACH ROW EXECUTE PROCEDURE
base.update_updated_by_id();
/*Drop column*/
ALTER TABLE base.sys_user DROP COLUMN password;
/*Drop old triggers*/
DROP TRIGGER user_hash_password ON base.sys_user;
DROP TRIGGER user_update_password ON base.sys_user;
/*Rename old triggers*/
ALTER TRIGGER user_updated_by_id ON base.sys_user RENAME TO user_update_updated_by_id;
/*Refresh permissions*/
GRANT USAGE ON SCHEMA base TO anonymous;
GRANT SELECT ON ALL TABLES IN SCHEMA base TO anonymous;
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA base TO advanced;
GRANT REFERENCES ON ALL TABLES IN SCHEMA base TO advanced;
GRANT INSERT, UPDATE, DELETE ON base.sys_list TO advanced;
GRANT INSERT, UPDATE, DELETE ON base.sys_attribute TO advanced;
GRANT UPDATE ON ALL SEQUENCES IN SCHEMA base TO admin; /*Required to reset Id sequence during backup and restore*/
GRANT UPDATE ON ALL SEQUENCES IN SCHEMA public TO admin; /*Required to reset Id sequence during backup and restore*/
GRANT INSERT, UPDATE, DELETE ON base.sys_user TO admin;
GRANT INSERT, UPDATE, DELETE ON base.sys_password TO admin;
GRANT INSERT, UPDATE, DELETE ON base.sys_user_group TO admin;
GRANT INSERT, UPDATE, DELETE ON base.sys_user_group_membership TO admin;
GRANT INSERT, UPDATE, DELETE ON base.sys_data_type TO ADMIN;
from listof.
Related Issues (20)
- Add backup and restore feature for admin HOT 1
- Allow many to many relationships management in the UI
- Direct URL return 404 in production mode
- User group names not updated in Edit List view after being renamed
- Sort attributes in form view
- Add created by and updated by in CSV export
- Use custom Docker image for PostGraphile
- Redirect to login page when JWT expired
- Fix hot reload in development mode
- Setup project to use production mode
- Search all columns not working when one column is null
- Fix PostGraphile error not able to access stream
- Add sort feature in list table
- Add sort feature in user table
- Add sort feature in user group table
- Default attribute order upon creation
- Linked attribute shows NaN when creating new value
- Ignore empty lines when importing CSV file
- Upgrade Vue.js version to remove vulnerabilities
- Simplify data types management
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from listof.