Skip to content
Snippets Groups Projects
Commit ebcda2cc authored by Martin Lees's avatar Martin Lees
Browse files

code style

parent df102d8e
No related branches found
No related tags found
No related merge requests found
...@@ -32,24 +32,24 @@ LANGUAGE plpgsql ...@@ -32,24 +32,24 @@ LANGUAGE plpgsql
as as
$$ $$
declare declare
_community_type_id SMALLINT; __community_type_id SMALLINT;
_role_id SMALLINT; __role_id SMALLINT;
_member_role CONSTANT SMALLINT := 2; __member_role CONSTANT SMALLINT := 2;
_community_type_topic CONSTANT SMALLINT := 1; __community_type_topic CONSTANT SMALLINT := 1;
_community_type_journal CONSTANT SMALLINT := 2; __community_type_journal CONSTANT SMALLINT := 2;
_community_type_council CONSTANT SMALLINT := 3; __community_type_council CONSTANT SMALLINT := 3;
BEGIN BEGIN
SELECT type_id INTO _community_type_id FROM hive_communities WHERE id = _community_id; SELECT type_id INTO __community_type_id FROM hive_communities WHERE id = _community_id;
IF _community_type_id = _community_type_topic THEN IF __community_type_id = __community_type_topic THEN
return true; -- Community type 1 allows everyone to post & comment return true; -- Community type 1 allows everyone to post & comment
ELSE ELSE
IF _community_type_id = _community_type_journal AND is_comment = TRUE THEN IF __community_type_id = __community_type_journal AND is_comment = TRUE THEN
RETURN TRUE; -- Community type journal allows everyone to comment RETURN TRUE; -- Community type journal allows everyone to comment
END IF; END IF;
select role_id into _role_id from hive_roles where community_id = _community_id AND account_id = _author_id; select role_id into __role_id from hive_roles where community_id = _community_id AND account_id = _author_id;
IF _community_type_id = _community_type_journal AND is_comment = FALSE AND _role_id IS NOT NULL AND _role_id >= _member_role THEN IF __community_type_id = __community_type_journal AND is_comment = FALSE AND __role_id IS NOT NULL AND __role_id >= __member_role THEN
RETURN TRUE; -- You have to be at least a member to post RETURN TRUE; -- You have to be at least a member to post
ELSIF _community_type_id = _community_type_council AND _role_id IS NOT NULL AND _role_id >= _member_role THEN ELSIF __community_type_id = __community_type_council AND __role_id IS NOT NULL AND __role_id >= __member_role THEN
RETURN TRUE; -- You have to be at least a member to post or comment RETURN TRUE; -- You have to be at least a member to post or comment
END IF; END IF;
END IF; END IF;
...@@ -74,7 +74,6 @@ RETURNS TABLE (is_new_post boolean, id hive_posts.id%TYPE, author_id hive_posts. ...@@ -74,7 +74,6 @@ RETURNS TABLE (is_new_post boolean, id hive_posts.id%TYPE, author_id hive_posts.
LANGUAGE plpgsql LANGUAGE plpgsql
AS AS
$function$ $function$
#variable_conflict use_variable
BEGIN BEGIN
INSERT INTO hive_permlink_data INSERT INTO hive_permlink_data
......
  • Howo @howo

    mentioned in commit adaf0414

    ·

    mentioned in commit adaf0414

    Toggle commit list
  • Howo @howo

    mentioned in commit 20480803

    ·

    mentioned in commit 20480803

    Toggle commit list
  • Howo @howo

    mentioned in commit cd01716c

    ·

    mentioned in commit cd01716c

    Toggle commit list
  • Howo @howo

    mentioned in commit e88b39ff

    ·

    mentioned in commit e88b39ff

    Toggle commit list
  • Howo @howo

    mentioned in commit a3bd6741

    ·

    mentioned in commit a3bd6741

    Toggle commit list
  • Howo @howo

    mentioned in commit 13e985d4

    ·

    mentioned in commit 13e985d4

    Toggle commit list
  • Howo @howo

    mentioned in commit f9f460d7

    ·

    mentioned in commit f9f460d7

    Toggle commit list
  • Howo @howo

    mentioned in commit 80a3a3a1

    ·

    mentioned in commit 80a3a3a1

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment