Discussion:
Granting access to SYSTEM_MAKE_BACKUP() function
Duncan Groenewald
2007-06-21 06:28:47 UTC
Permalink
Hi, can I use the GRANT function to grant access to this function
for user ? If not how can I grant permission to execute this
function to a user ?


---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
To unsubscribe, send a message to mckoidb-***@mckoi.com
Tobias Downer
2007-06-22 16:16:39 UTC
Permalink
Hi Duncan,

The command to grant a user access to the SYSTEM_MAKE_BACKUP function
would be,

grant all on SYS_INFO.SYSTEM_MAKE_BACKUP to [username];

Provided this is run by an admin user, it will create a grant to use
that function by the user.

Toby.
Hi, can I use the GRANT function to grant access to this function for
user ? If not how can I grant permission to execute this function to a
user ?
---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
To unsubscribe, send a message to mckoidb-***@mckoi.com
Duncan Groenewald
2007-06-23 11:53:39 UTC
Permalink
I just tried this but get the following error:

Backup Database
"Exception executing query"
"User not permitted to call: SYSTEM_MAKE_BACKUP"

is there any way I can check whether permissions have been created ?
Post by Tobias Downer
grant all on SYS_INFO.SYSTEM_MAKE_BACKUP to [username]
Tobias Downer
2007-06-27 01:48:18 UTC
Permalink
Hi,

The following query may help you,

SELECT * FROM SYS_INFO.sUSRGrant;

Look for "SYS_INFO.SYSTEM_MAKE_BACKUP" under the param column, the
grantee should be "@PUBLIC". You may need to restart the database after
grants are altered.

Toby.
Post by Duncan Groenewald
Backup Database
"Exception executing query"
"User not permitted to call: SYSTEM_MAKE_BACKUP"
is there any way I can check whether permissions have been created ?
Post by Tobias Downer
grant all on SYS_INFO.SYSTEM_MAKE_BACKUP to [username]
---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
To unsubscribe, send a message to mckoidb-***@mckoi.com
Duncan Groenewald
2007-06-27 11:22:23 UTC
Permalink
Post by Tobias Downer
Hi,
The following query may help you,
SELECT * FROM SYS_INFO.sUSRGrant;
Look for "SYS_INFO.SYSTEM_MAKE_BACKUP" under the param column, the
after grants are altered.
Toby.
Post by Duncan Groenewald
Backup Database
"Exception executing query"
"User not permitted to call: SYSTEM_MAKE_BACKUP"
is there any way I can check whether permissions have been created ?
Post by Tobias Downer
grant all on SYS_INFO.SYSTEM_MAKE_BACKUP to [username]
---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
To unsubscribe, send a message to mckoidb-***@mckoi.com
Tobias Downer
2007-06-29 22:25:37 UTC
Permalink
I apologize. I just checked the code and the user must belong to the
"secure access" group to be able to call the backup procedure, so you
need to add the user to this group if you wish for them to use the
backup function. The simplest way to do this is by using the following
command;

insert into SYS_INFO.sUSRUserPriv ( UserName, PrivGroupName ) values
( '[username]', 'secure access' );

Toby.
Post by Tobias Downer
Hi,
The following query may help you,
SELECT * FROM SYS_INFO.sUSRGrant;
Look for "SYS_INFO.SYSTEM_MAKE_BACKUP" under the param column, the
after grants are altered.
Toby.
Post by Duncan Groenewald
Backup Database
"Exception executing query"
"User not permitted to call: SYSTEM_MAKE_BACKUP"
is there any way I can check whether permissions have been created ?
Post by Tobias Downer
grant all on SYS_INFO.SYSTEM_MAKE_BACKUP to [username]
---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
To unsubscribe, send a message to mckoidb-***@mckoi.com
Duncan Groenewald
2007-07-03 11:09:41 UTC
Permalink
Is there any way I can 'hack' this without doing too much damage ? I
don't want users to have any special privileges, just the ability to
run a backup. Would it be possible to modify the code to allow
normal users to run this procedures is they have USAGE permission on
the function ? I realise you probably don't want to modify your
version of the code but could you point me to where I might modify my
own version ?

Thanks
Post by Tobias Downer
I apologize. I just checked the code and the user must belong to
the "secure access" group to be able to call the backup procedure,
so you need to add the user to this group if you wish for them to
use the backup function. The simplest way to do this is by using
the following command;
insert into SYS_INFO.sUSRUserPriv ( UserName, PrivGroupName )
values ( '[username]', 'secure access' );
Toby.
Post by Tobias Downer
Hi,
The following query may help you,
SELECT * FROM SYS_INFO.sUSRGrant;
Look for "SYS_INFO.SYSTEM_MAKE_BACKUP" under the param column,
database after grants are altered.
Toby.
Post by Duncan Groenewald
Backup Database
"Exception executing query"
"User not permitted to call: SYSTEM_MAKE_BACKUP"
is there any way I can check whether permissions have been
created ?
Post by Tobias Downer
grant all on SYS_INFO.SYSTEM_MAKE_BACKUP to [username]
---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
To unsubscribe, send a message to mckoidb-***@mckoi.com
Duncan Groenewald
2007-07-03 11:38:52 UTC
Permalink
Looking at the Database.java code could I modify the method below to
check if the user has SELECT permission ?

/**
* Returns true if the user is allowed to execute the given stored
procedure.
*/
public boolean canUserExecuteStoredProcedure(DatabaseQueryContext
context,
User user, String procedure_name) throws
DatabaseException {
// Currently you can only execute a procedure if you are a
member of the
// secure access priv group.
return userHasSecureAccess(context, user);
}


/**
* Returns true if the user is allowed to execute the given stored
procedure.
*/
public boolean canUserExecuteStoredProcedure(DatabaseQueryContext
context,
User user, String procedure_name) throws
DatabaseException {
if (userHasSchemaGrant(context, user,
table.getSchema(),
Privileges.PROCEDURE_EXECUTE_PRIVS)) {
return true;
}
// Currently you can only execute a procedure if you are a
member of the
// secure access priv group.
return userHasSecureAccess(context, user);
}
Post by Tobias Downer
I apologize. I just checked the code and the user must belong to
the "secure access" group to be able to call the backup procedure,
so you need to add the user to this group if you wish for them to
use the backup function. The simplest way to do this is by using
the following command;
insert into SYS_INFO.sUSRUserPriv ( UserName, PrivGroupName )
values ( '[username]', 'secure access' );
Toby.
Post by Tobias Downer
Hi,
The following query may help you,
SELECT * FROM SYS_INFO.sUSRGrant;
Look for "SYS_INFO.SYSTEM_MAKE_BACKUP" under the param column,
database after grants are altered.
Toby.
Post by Duncan Groenewald
Backup Database
"Exception executing query"
"User not permitted to call: SYSTEM_MAKE_BACKUP"
is there any way I can check whether permissions have been
created ?
Post by Tobias Downer
grant all on SYS_INFO.SYSTEM_MAKE_BACKUP to [username]
---------------------------------------------------------------
Mckoi SQL Database mailing list http://www.mckoi.com/database/
Loading...