CakePHPのACLで権限一覧を見る時のMySQLクエリー

# MySQLクエリー - パーミッション一覧
SELECT
  aros_acos.id AS aros_acos_id,
  aros.model,
  groups.name,
  acos.alias,
  acos.lft,
  acos.rght,
  aros_acos._create,
  aros_acos._read,
  aros_acos._update,
  aros_acos._delete
FROM
  aros_acos
LEFT JOIN aros   ON aros_acos.aro_id = aros.id
LEFT JOIN acos   ON aros_acos.aco_id = acos.id
LEFT JOIN groups ON aros.foreign_key = groups.id
;

↓↓↓ こんな感じの結果になる ↓↓↓

aros_acos_id model name alias lft rght _create _read _update _delete
115 Group users edit 81 82 1 1 1 1
97 Group administrators logout 51 52 -1 -1 -1 -1
98 Group administrators view 47 48 -1 -1 -1 -1

One Reply to “CakePHPのACLで権限一覧を見る時のMySQLクエリー”

Comments are closed.