DataSource for C SDK  6.2.20.310828
Publishing Permission Objects

Functions

void ds_add_permission_key (ds_data_t *data, const char *key)
 Set the key for a permission object. Must be called either first, or immediately after inserting a seperator. More...
 
ds_data_tds_init_permission (const char *subject, const char *key, unsigned short flags)
 Initialise a data object as a permission object. More...
 

Detailed Description

Permission object support.

The permission object is an object that will notify Liberator auth modules when it's updated

Example usage of a permission object.

ds_data_t *pkt = ds_init_permission(PERMISSION_OBJECT_NAME, PERMISSION_KEY, F_CREATEOBJECT | F_CREATEPARENT);
ds_add_data(pkt, PERMISSION_VALUE_FIELDNUMBER, VALUE);

You can use ds_add_record_data instead of add_data if you want.

If you are sending multiple Permissions in one packet you can use the ds_add_permission_key and ds_add_data with DS_FIELDS_SEPARATOR

Example:

for (i = 0; i != num_items; ++i)
{
ds_add_permission_key(pkt, item_name[i]);
ds_add_record_data(pkt, "pValue", item_value[i]);
}

Function Documentation

void ds_add_permission_key ( ds_data_t data,
const char *  key 
)

Set the key for a permission object. Must be called either first, or immediately after inserting a seperator.

Parameters
data- The permission object
key- The key to insert
ds_data_t* ds_init_permission ( const char *  subject,
const char *  key,
unsigned short  flags 
)

Initialise a data object as a permission object.

Parameters
subject- The name of the object
key- The Permission key for this object. May be NULL
flags- Object flags

Generated on Wed Jan 24 2018 12:22:46 for DataSource for C SDK