psSetPermissions

Description

     This program takes the tedium out of creating scripts which grant or
revoke permissions on groups of objects to groups of users.  Given a security
configuration file like,
/disk2/ceccareb/PS/dbaccess/parameters/security.cfg
you can generate thousands of grant and revoke command instantly for thousands
of users or groups.   Without the security configuration file, you can still
generate thousands of grants on all objects of a database to a single user or
group.

 

Syntax

psSetPermissions -Sserver -Ulogin_username -Ppassword -Ddatabase
-Csecurity_config_file
-Ndb_user -Wowner_of_objects
-Ooptions -Foutput_script_name

 

Arguments

-S

Sybase Server Name

-U

Sybase User Name

-P

Sybase User's Password

-D

Sybase Database

-C

Security Configuration File

-N

Database User or Group Name

-W

Owner of Target Objects

-F

Output Korn Shell script

-O

Options

 

Options

s

Stop if I find an object or user which does not exist in the database.

r

Revoke permissions first

x

Grant read permissions on all tables and views.  Grant execute on every stored procedure.

a

Grant all permissions on all objects.  This option only used when you do not use -C.

 

Environment Variables Behind the Scenes

DSQUERY

When -S is not specified

SYB_USER

When -U is not specified

SYB_PASS

When -P is not specified

SYB_DATABASE

When -D is not specified

PS_SYSMSG_FILE

Name of the tool's messages file

 

Notes

   If you do not specify a security configuration file, I look at the -N and -W

arguments

I grant 'select' permission on all objects owned by -W to the user -N.
I also grant execute permissions on those stored procedures, owned by -W, which
only 'select' from tables.  (Yes, I know which procs those are.)   If you
specified the -Oa option, then I grant all permissions on all objects.  If
specified the -Ox option, then I grant 'select' permissions on tables and
views, and execute permissions on all procs.
   If you specify the -C argument, I read that security configuration file and
generate all the grants and revokes implied in the file.  You cannot specify
-N or -W when you specify -C.
   If you specify neither -C, -N or -W, then I grant 'select' permissions on all
objects owned by 'dbo' to 'public'.  I grant execute permission on the stored procs
owned by 'dbo' which only select from tables.   If you specified the -Ox option,
I grant execute permission on all dbo's procs to 'public'.
   -Or revokes object permissions.  You can use -Or with -Oa or -Ox.  I will revoke
permissions before granting any new ones.   You cannot use -Or with -C.  The syntax
within a security configuration file gives you the ability to revoke permissions
with finer granularity.

 

Go to DBPowerSuite 7.9 List of Programs.


Updated: Thu Jun 18 21:12:26 2009