Subject Re: [firebird-support] Problems with creating new users (no permission for INSERT access to TABLE PLG$VIEW_USERS)
Author Bryan Cole
On Tue, 2018-12-18 at 12:12 +0100, Dimitry Sibiryakov sd@... [firebird-support] wrote:
18.12.2018 12:04, 'Bryan  Cole' bryan.cole@... [firebird-support] wrote:
[mypc]$ isql-fb -u test -p test -r rdb$admin localhost:mydatabase
Database: localhost:mydatabase, User: TEST

   At first, role rdb$admin wasn't granted to this user and applied how you can see in 
second quoted line.
   At second, grants are per-database, so the role must be granted in the database that 
keeps list of users.


OK, Thanks for the comments. I don't understand what I need to do different to fix these things.

The v2.5 docs indicate I should simple append "GRANT ADMIN ROLE" when I create the test-user in order to grant the RDB$ADMIN role.
Are the docs incorrect or out-of-date for v3.0.x? 

This doesn't work for me:

[mypc]$ isql-fb -u SYSDBA -p mydbapassword localhost:mydatabase
Database: localhost:mydatabase, User: SYSDBA
SQL> 
SQL> ALTER USER test GRANT RDB$ADMIN ROLE;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 23
-RDB$ADMIN
SQL> exit;


If there is documentation explaining how this works in firebird-v3 (I didn't have a problem in v2.5), please help me with a link to it.

This also doesn't work:

[mypc]$ isql-fb -u SYSDBA -p mydbapassword localhost:mydatabase
Database: localhost:mydatabase, User: SYSDBA
SQL> GRANT RDB$ADMIN TO test;
SQL> commit;
SQL> exit;
[mypc]$ isql-fb -u test -p test -r rdb$admin localhost:mydatabase
Database: localhost:mydatabase, User: TEST
SQL> create user owner password 'owner';
Statement failed, SQLSTATE = 28000
add record error
-no permission for INSERT access to TABLE PLG$VIEW_USERS
SQL> 


If someone could post an example of the actual correct approach to achieving a non-SYSDBA user who can create/drop other users, 
I'd be most grateful.

Thanks,
Bryan

-- 
Group Leader, Technical Development Group - Teraview Ltd.
Platinum Building, St. John's Innovation Park, Cambridge CB4 0DS, UK.
tel: +44 (0)1223 435386, fax: +44 (0)1223 435382, web: www.teraview.com Registered Number: 04126946, VAT Number: 770 8883 84

...preferred document formats: ODF (ISO/IEC 26300:2006), PDF