GstRTSPPermissions

## GstRTSPPermissions GstRTSPPermissions — Roles and associated permissions |

## Synopsis

    struct              GstRTSPPermissions;
    GstRTSPPermissions * gst_rtsp_permissions_new           (void);
    GstRTSPPermissions * gst_rtsp_permissions_ref           (GstRTSPPermissions *permissions);
    void                gst_rtsp_permissions_unref          (GstRTSPPermissions *permissions);
    void                gst_rtsp_permissions_add_role       (GstRTSPPermissions *permissions,
                                                             const gchar *role,
                                                             const gchar *fieldname,
                                                             ...);
    void                gst_rtsp_permissions_add_role_valist
                                                            (GstRTSPPermissions *permissions,
                                                             const gchar *role,
                                                             const gchar *fieldname,
                                                             va_list var_args);
    void                gst_rtsp_permissions_remove_role    (GstRTSPPermissions *permissions,
                                                             const gchar *role);
    const GstStructure * gst_rtsp_permissions_get_role      (GstRTSPPermissions *permissions,
                                                             const gchar *role);
    gboolean            gst_rtsp_permissions_is_allowed     (GstRTSPPermissions *permissions,
                                                             const gchar *role,
                                                             const gchar *permission);

## Description

The GstRTSPPermissions object contains an array of roles and associated permissions. The roles are represented with a string and the permissions with a generic GstStructure.

The permissions are deliberately kept generic. The possible values of the roles and GstStructure keys and values are only determined by the GstRTSPAuth object that performs the checks on the permissions and the current GstRTSPToken.

As a convenience function, `gst_rtsp_permissions_is_allowed()` can be used to check if the permissions contains a role that contains the boolean value `TRUE` for the the given key.

Last reviewed on 2013-07-15 (1.0.0)

## Details

### struct GstRTSPPermissions

    struct GstRTSPPermissions {
      GstMiniObject mini_object;
    };

The opaque permissions structure. It is used to define the permissions of objects in different roles.

### gst_rtsp_permissions_new ()

    GstRTSPPermissions * gst_rtsp_permissions_new           (void);

Create a new empty Authorization permissions.

Returns : | a new empty authorization permissions. [transfer full]

### gst_rtsp_permissions_ref ()

    GstRTSPPermissions * gst_rtsp_permissions_ref           (GstRTSPPermissions *permissions);

Increase the refcount of this permissions.

`permissions` : | The permissions to refcount
Returns : | `permissions` (for convenience when doing assignments). [transfer full]

### gst_rtsp_permissions_unref ()

    void                gst_rtsp_permissions_unref          (GstRTSPPermissions *permissions);

Decrease the refcount of an permissions, freeing it if the refcount reaches 0.

`permissions` : | the permissions to refcount. [transfer full]

### gst_rtsp_permissions_add_role ()

    void                gst_rtsp_permissions_add_role       (GstRTSPPermissions *permissions,
                                                             const gchar *role,
                                                             const gchar *fieldname,
                                                             ...);

Add a new `role` to `permissions` with the given variables. The fields are the same layout as `gst_structure_new()`.

`permissions` : | a GstRTSPPermissions
`role` : | a role
`fieldname` : | the first field name
`...` : | additional arguments

### gst_rtsp_permissions_add_role_valist ()

    void                gst_rtsp_permissions_add_role_valist
                                                            (GstRTSPPermissions *permissions,
                                                             const gchar *role,
                                                             const gchar *fieldname,
                                                             va_list var_args);

Add a new `role` to `permissions` with the given variables. Structure fields are set according to the varargs in a manner similar to `gst_structure_new()`.

`permissions` : | a GstRTSPPermissions
`role` : | a role
`fieldname` : | the first field name
`var_args` : | additional fields to add

### gst_rtsp_permissions_remove_role ()

    void                gst_rtsp_permissions_remove_role    (GstRTSPPermissions *permissions,
                                                             const gchar *role);

Remove all permissions for `role` in `permissions`.

`permissions` : | a GstRTSPPermissions
`role` : | a role

### gst_rtsp_permissions_get_role ()

    const GstStructure * gst_rtsp_permissions_get_role      (GstRTSPPermissions *permissions,
                                                             const gchar *role);

Get all permissions for `role` in `permissions`.

`permissions` : | a GstRTSPPermissions
`role` : | a role
Returns : | the structure with permissions for `role`.

### gst_rtsp_permissions_is_allowed ()

    gboolean            gst_rtsp_permissions_is_allowed     (GstRTSPPermissions *permissions,
                                                             const gchar *role,
                                                             const gchar *permission);

Check if `role` in `permissions` is given permission for `permission`.

`permissions` : | a GstRTSPPermissions
`role` : | a role
`permission` : | a permission
Returns : | `TRUE` if `role` is allowed `permission`.

## See Also

GstRTSPToken, GstRTSPAuth