Security

如何在 Firebird 1.5 上授予/撤銷使用者權限?

  • September 10, 2016

我需要在 firebird 1.5 中創建一個使用者並授予他訪問某些特定表的權限。我設法創建了使用者,但顯然 GRANT/REVOKE 操作僅適用於 2.1 或更高版本。那麼,該怎麼做呢?

更新

實際上我弄錯了,GRANT 和 REVOKE 在 1.5 版中都可以正常工作。

Firebird 已經擁有GRANT並且REVOKE從其初始版本開始。請參閱http://www.firebirdsql.org/en/reference-manuals/上的 Interbase 6.0 語言參考(接近頁面末尾)。

例如GRANT

GRANT <privileges> ON [TABLE] {tablename | viewname}
      TO {<object> | <userlist> | GROUP UNIX_group}
  | EXECUTE ON PROCEDURE procname TO {<object> | <userlist>}
  | <role_granted> TO {PUBLIC | <role_grantee_list>};
<privileges> = {ALL [PRIVILEGES] | <privilege_list>}
<privilege_list> = SELECT
  | DELETE
  | INSERT
  | UPDATE [(col [, col ...])]
  | REFERENCES [(col [, col ...])] [, <privilege_list> ...]
<object> = PROCEDURE procname
  | TRIGGER trigname
  | VIEW viewname
  | PUBLIC
  [, <object> ...]
<userlist> = [USER] username
  | rolename
  | Unix_user}
  [, <userlist> ...]
  [WITH GRANT OPTION]
<role_granted> = rolename [, rolename ...]
<role_grantee_list> = [USER] username [, [USER] username ...] [WITH ADMIN OPTION]

對於REVOKE

REVOKE [GRANT OPTION FOR] <privileges> ON [TABLE]
          {tablename | viewname}
       FROM {<object> | <userlist> | <rolelist> | GROUP UNIX_group}
   | EXECUTE ON PROCEDURE procname
       FROM {<object> | <userlist>}
   | <role_granted> FROM {PUBLIC | <role_grantee_list>}};
<privileges> = {ALL [PRIVILEGES] | <privilege_list>} <privilege_list> = {
SELECT
   | DELETE
   | INSERT
   | UPDATE [(col [, col ...])]
   | REFERENCES [(col [, col ...])] [, <privilege_list> ...]}}
<object> ={
   PROCEDURE procname
   | TRIGGER trigname
   | VIEW viewname
   | PUBLIC
   [, <object>]}
<userlist> = [USER] username [, [USER] username ...]
<rolelist> = rolename [, rolename]
<role_granted> = rolename [, rolename ...]
<role_grantee_list> = [USER] username [, [USER] username ...]

Firebird 文件曾經在最初的 Interbase 6 文件和語言參考更新中被分散,該更新僅描述了較新版本中引入的更改。

但是現在有一個完整的Firebird 2.5 語言參考

引用自:https://dba.stackexchange.com/questions/101543