AgsController

AgsController — base controller

Functions

Properties

gchar * context-path Read / Write
AgsServer * server Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── AgsController

Includes

#include <ags/server/controller/ags_controller.h>

Description

The AgsController is a base object to implement controllers.

Functions

ags_controller_resource_alloc ()

AgsControllerResource *
ags_controller_resource_alloc (gchar *group_id,
                               gchar *user_id,
                               guint access_mode);

Allocated AgsControllerResource.

Parameters

group_id

the group id

 

user_id

the user id

 

access_mode

the access mode

 

Returns

the newly allocated AgsControllerResource

Since: 1.0.0


ags_controller_resource_free ()

void
ags_controller_resource_free (AgsControllerResource *controller_resource);

Free controller_resource .

Parameters

controller_resource

the AgsControllerResource

 

Since: 1.0.0


ags_controller_add_resource ()

void
ags_controller_add_resource (AgsController *controller,
                             gchar *resource_name,
                             AgsControllerResource *controller_resource);

Add controller_resource with key resource_name to hash table.

Parameters

controller

the AgsController

 

resource_name

the resource name as string

 

controller_resource

the AgsControllerResource

 

Since: 1.0.0


ags_controller_remove_resource ()

void
ags_controller_remove_resource (AgsController *controller,
                                gchar *resource_name);

Remove key resource_name from hash table.

Parameters

controller

the AgsController

 

resource_name

the resource name as string

 

Since: 1.0.0


ags_controller_lookup_resource ()

AgsControllerResource *
ags_controller_lookup_resource (AgsController *controller,
                                gchar *resource_name);

Lookup key resource_name in hash table.

Parameters

controller

the AgsController

 

resource_name

the resource name as string

 

Returns

the matchin AgsControllerResource

Since: 1.0.0


ags_controller_query_security_context ()

gboolean
ags_controller_query_security_context (AgsController *controller,
                                       GObject *security_context,
                                       gchar *login);

Query security_context for login .

Parameters

controller

the AgsController

 

security_context

the AgsSecurityContext

 

login

the login to query

 

Returns

TRUE if allowed to proceed, otherwise FALSE

Since: 1.0.0


ags_controller_new ()

AgsController *
ags_controller_new ();

Instantiate new AgsController

Returns

the AgsController

Since: 1.0.0


AGS_CONTROLLER()

#define AGS_CONTROLLER(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_CONTROLLER, AgsController))

AGS_CONTROLLER_CLASS()

#define AGS_CONTROLLER_CLASS(class)        (G_TYPE_CHECK_CLASS_CAST(class, AGS_TYPE_CONTROLLER, AgsControllerClass))

AGS_CONTROLLER_GET_CLASS()

#define AGS_CONTROLLER_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS(obj, AGS_TYPE_CONTROLLER, AgsControllerClass))

AGS_IS_CONTROLLER()

#define AGS_IS_CONTROLLER(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AGS_TYPE_CONTROLLER))

ags_controller_get_type ()

GType
ags_controller_get_type ();

Types and Values

AGS_CONTROLLER_BASE_PATH

#define AGS_CONTROLLER_BASE_PATH "/ags-server"

struct AgsControllerResource

struct AgsControllerResource {
  gchar *group_id;
  gchar *user_id;

  guint access_mode;
};

Specifing attributes of resources.

Members

gchar *group_id;

the group id of permissions

 

gchar *user_id;

the user id of permissions

 

guint access_mode;

the access mode of permissions

 

AGS_TYPE_CONTROLLER

#define AGS_TYPE_CONTROLLER                (ags_controller_get_type())

struct AgsController

struct AgsController;

struct AgsControllerClass

struct AgsControllerClass {
  GObjectClass gobject;
  
  gboolean (*query_security_context)(AgsController *controller,
				     GObject *security_context, gchar *login);
};

Property Details

The “context-path” property

  “context-path”             gchar *

The context path provided.

Flags: Read / Write

Default value: NULL

Since: 1.0.0


The “server” property

  “server”                   AgsServer *

The assigned AgsServer

Flags: Read / Write

Since: 1.0.0