changeset 935:c17e67348950 draft

Separate grp_* judgement in isfilereadable()
author HIROSE Yuuji <yuuji@gentei.org>
date Thu, 29 Apr 2021 15:40:37 +0900
parents 9184aa358773
children 789258aa857a
files s4-funcs.sh
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/s4-funcs.sh	Tue Apr 06 14:51:44 2021 +0900
+++ b/s4-funcs.sh	Thu Apr 29 15:40:37 2021 +0900
@@ -536,7 +536,16 @@
   #      fi
   # esac
   # ↑ 要はこういう処理を↓で一気にやっている
-  sql="with getblog as (
+  case "$2" in
+    grp_*)
+      sql="SELECT 'owner'
+	FROM grp_adm
+	WHERE gname=(SELECT gname FROM $2 WHERE rowid=$3)
+	      AND
+	      user = '$user';"
+      ;;
+    *)
+      sql="with getblog as (
 	select key,val from blog_s where id=(
 	select blogid from article where id in
         	(select id from $2 where rowid=$3))),
@@ -574,6 +583,8 @@
 		id=(select id from $2 where rowid=$3))='$1'
 	then 'user+author'
 	else '' end;"
+      ;;
+  esac
   ## err isfilereadable: sql="`echo $sql`"
   # caseのネストで内側のcaseがスカラーtrueを返しても外側はtrue扱いにならない
   # result=`query "$sql"`

yatex.org