%SYS
All Classes Namespaces Functions Variables Pages
Resources Class Reference

Define the security Resource database, and methods which manipulate them. More...

Inheritance diagram for Resources:
Collaboration diagram for Resources:

Static Public Member Functions

_.Library.Status Create (_.Library.String Name, _.Library.String Description, Security.Datatype.Permission PublicPermission, _.Library.Integer Type)
 Create a Resource. More...
 
_.Library.Status Delete (_.Library.String Name)
 Delete a resource. More...
 
_.Library.Boolean Exists (_.Library.String Name, _.Library.ObjectHandle Resource, _.Library.Status Status)
 Resource exists. More...
 
_.Library.Status Export (_.Library.String FileName, _.Library.Integer NumExported, _.Library.String Resources, _.Library.Integer PublicPermissions, _.Library.Integer Type)
 This method exports Resource records to a file in xml format. More...
 
_.Library.Status Get (_.Library.String Name, _.Library.String Properties)
 Get a resource's properties. More...
 
_.Library.Status Import (_.Library.String FileName, _.Library.Integer NumImported, _.Library.Integer Flags)
 Import Resource records from an xml file. More...
 
_.Library.Status InUse (_.Library.String Name, _.Library.Status InUse, _.Library.List Roles, _.Library.List Databases, _.Library.List Applications, _.Library.Integer Flags)
 Checks if the resource is in use. More...
 
_.Library.Status Modify (_.Library.String Name, _.Library.String Properties)
 Modify a resource. More...
 

Public Attributes

 Description
 Description of the resource. More...
 
 Name
 Name of the resource. More...
 
 PublicPermission
 Public permissions on the resource. More...
 
 Type
 Type - Bitmap describing the type of resource. More...
 

Detailed Description

Define the security Resource database, and methods which manipulate them.


The system includes a set of pre-defined System resources. Some properties of the system resources may not be modified.

Resource names have the following properties:
1) Resource names are case insensitive.
2) Maximum length of a resource name is 64 characters.
3) First Character after the "_" cannot be a % for user-defined resources
4) Resource names cannot contain a "," or ":"

The Admin_Secure:USE permission is required to operate on a resource

The table for this class should be manipulated only through object access, the published API's or through the System Management Portal. It should not be updated through direct SQL access.

Member Function Documentation

◆ Create()

_.Library.Status Create ( _.Library.String  Name,
_.Library.String  Description,
Security.Datatype.Permission  PublicPermission,
_.Library.Integer  Type 
)
static

Create a Resource.


Creates a Resource in the Security database.
Parameters:
Name - Name of the resource to create
Description- Description of the resource
PublicPermission - Public permission on the resource
May be one or more of "R","W","U"
Type - Internal use only, User defined resources should not pass this parameter

◆ Delete()

_.Library.Status Delete ( _.Library.String  Name)
static

Delete a resource.


This method will delete a resource from the security database. After the resource is deleted, it will update all the roles which hold this resource to remove the resource from the role. It will then update the in-memory security tables to mark this resource as "No access" for all roles, and "no access" for its public permissions.
Access to these resources will then be restricted only to users who own the All role.
Parameters:
Name - Name of the resource to delete

◆ Exists()

_.Library.Boolean Exists ( _.Library.String  Name,
_.Library.ObjectHandle  Resource,
_.Library.Status  Status 
)
static

Resource exists.


This method checks for the existence of a resource in the security database.
Parameters:
Name - Name of the resource to check existence of
Return values:
If Value of the method = 0 (Resource does not exist, or some error occured)
Resource = Null
Status = Resource "x" does not exist, or other error message<br>
If Value of the method = 1 (Resource exists)
Resource = Object handle to resource
Status = $$$OK

◆ Export()

_.Library.Status Export ( _.Library.String  FileName,
_.Library.Integer  NumExported,
_.Library.String  Resources,
_.Library.Integer  PublicPermissions,
_.Library.Integer  Type 
)
static

This method exports Resource records to a file in xml format.


Parameters:
Filename - Output file name
NumExported (byref) - Returns number of records exported.
Resources - Comma separated list of Resources to export, "*" = All
PublicPermissions - Only export those with this type of public permissions
-1 = All
Bit 0 - Read public permission
Bit 1 - Write public permission
Bit 2 - Use public permission
Bit 9 - No public permission
Type - Internal use only, pass -1

◆ Get()

_.Library.Status Get ( _.Library.String  Name,
_.Library.String  Properties 
)
static

Get a resource's properties.


Gets a resource's properties from the security database.
Parameters:
Name - Name of the resource to get
Return values:
Properties - Array of resource properties
Properties("Description")- Description of the resource
Properties("PublicPermission") - Public permission on the resource
May be one or more of "R","W","U"
Properties("Type") - Internal use only

◆ Import()

_.Library.Status Import ( _.Library.String  FileName,
_.Library.Integer  NumImported,
_.Library.Integer  Flags 
)
static

Import Resource records from an xml file.


Parameters:
FileName - Filename to import Resource records from
NumImported (byref) - Returns number of records imported
Flags - Control import
Bit 0 - Do not import records, just return count
Note: On failure, no records will be imported

◆ InUse()

_.Library.Status InUse ( _.Library.String  Name,
_.Library.Status  InUse,
_.Library.List  Roles,
_.Library.List  Databases,
_.Library.List  Applications,
_.Library.Integer  Flags 
)
static

Checks if the resource is in use.


Checks if the resource specified is used by any role, application or database.
Parameters:
Name - Name of the resource to check.
Return values:
InUse = 0 Not used
InUse = 1 Used
Roles - $list of roles the resource is used by or null if none
Databases - $list of databases the resource is used by or null if none
Applications - $list of applications the resource is used by or null if none
Flags - Controls return values
Bit 0 - Return roles in format $lb(Role1_":"_Permission,Role2_":"_Permission)

◆ Modify()

_.Library.Status Modify ( _.Library.String  Name,
_.Library.String  Properties 
)
static

Modify a resource.


Modify an existing resource's properties in the security database.
Parameters:
Name - Name of the resource to modify
Properties - Array of properties to modify.
See the Get() method for a description of the Properties parameter.
If a specific property is not passed in the properties array, the value is not modified.

Member Data Documentation

◆ Description

Description

Description of the resource.


Description cannot be modified if a system defined resource.
 

◆ Name

Name

Name of the resource.


 

◆ PublicPermission

PublicPermission

Public permissions on the resource.


Bit 0 - Read
Bit 1 - Write
Bit 2 - Use<br>
Alternatively, you can set to this any of "RWU" or "READ,WRITE,USE"
 

◆ Type

Type

Type - Bitmap describing the type of resource.


Bit 0 = System initialized resource
Bit 1 = Database resource
Bit 2 = Service resource
Bit 3 - Application resource
Bit 4 - DeepSee resource
Bits 5-30 reserved
Bit 31 = User defined Resource
Bits 31-64 user defined <Reserved for future use>
Note that this property is set automatically by the filer and should not be set for user defined resources.
Do not modify this field directly except on initialization of system defaults.