BBjAdmin::getPermission

Description

In BBj 7.0 and higher, this method returns an indication of whether a user has a permission.

Syntax

Return Value

Method

int

getPermission(string username, int type)

Parameters

Variable

Description

username

The name of the user.

type

The type of permission.

Return Value

Returns 1 if user has permission, 0 if user does not have permission.

Remarks

Type must be one of the following values:

 

Option Value Description

Add User

BBjAdmin.ADD_USER

The user is allowed to create new user accounts.

Admin Access

BBjAdmin.ALLOW_ADMIN

The user is allowed to use the Enterprise Manager. If a user does not have this permission, they will not be able to log in to the Enterprise Manager.

Attach Existing DB

BBjAdmin.ATTACH_EXISTING_DB

The user is allowed to create a new database link by attaching to an existing set of data dictionary files.

BBj Processes

BBjAdmin.PROCESSES

The user is allowed to view the list of BBj Processes and terminate any of those processes.

Connection Pools

BBjAdmin.CONNECTION_POOLS

User is allowed to create, remove and modify JDBC connection pools that can be used from BBj applications.

Create New DB

BBjAdmin.CREATE_NEW_DB

The user is allowed to create a new database entirely from scratch.

Create Trigger

BBjAdmin.CREATE_NEW_TRIGGER

The user is allowed to create and drop triggers using the Enterprise Manager or via SQL.

Drop DB

BBjAdmin.DELETE_DB

The user is allowed to drop a database from the system including its data dictionary files and data files.

Force Close Open Data Files

BBjAdmin.FORCE_CLOSE_FILES

User can force open files to be closed.

Online Copy Jobs

BBjAdmin.COPY_JOBS

User is allowed to create, modify, run and terminate online copy jobs.

Remove User

BBjAdmin.DELETE_USER

The user is allowed to remove any user account except the "admin" account.

Replication Jobs

BBjAdmin.REPLICATION

User is allowed to create, modify, pause and terminate replication jobs.

Server Config

BBjAdmin.SERVER_CONFIG

The user is allowed to make changes to the server configuration (see Enterprise Manager - Server Information).

Set Passwords

BBjAdmin.SET_PASSWORDS

The user is allowed to set/change the password on other user accounts.

Set Permissions

BBjAdmin.SET_PERMISSIONS

The user is allowed to set these permissions for other user accounts.

SQL Connections

BBjAdmin.JDBC_CONNECTIONS

The user is allowed to view the list of ODBC/JDBC SQL connections and close any of those connections.

Table Analysis Queue

BBjAdmin.TABLE_ANALYSIS_QUEUE

User is allowed to view tables currently in the table analysis queue as well as stop table analysis if necessary.

View Open Files

BBjAdmin.OPEN_FILES

The user is allowed to view the list of currently open files in BBj. The can also force close any of these files.

Example

Admin! = BBjAPI().getAdmin("adminName", "adminPassword")
Admin!.addUser("AUser", "Password")
X = Admin!.getPermission("AUser, Admin!.CREATE_NEW_DB)

See Also

BBjAPI

BBjAdmin

BBjAdminEnvironment

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.