Authentication Services module I use services with drupal 7, here the services resources function :

function custom_api_services_resources()
{
    return [
        'res' =&gt; [
            'create' =&gt; [
                'callback' =&gt; 'custom_api_create_user',
                'access arguments' =&gt; array('administer access control'),
                'access arguments append' =&gt; FALSE,
                    'args' =&gt; [
                    [
                        'name' =&gt; 'data',
                        'type' =&gt; 'struct',
                        'description' =&gt; 'data',
                        'optional' =&gt; FALSE,
                        'source' =&gt; 'data'
                    ]
                ],
            ]
        ]
    ];
}


Here the node access function (empty) :

function custom_api_node_access($op, $data) { 
}


For Authentication I use HTTP basic authentication and/or Session authentication

I don't know what I have to do to limit access only for admin. I've tried a lot but never work with authentication.

I feel like it's very easy to use it, but I don't understand it.

I've already posted a message about this issue but differently. Can someone delete the first one, please ?  How do I use the access arguments?



Edit

custom_api.module file :

             'create' =&gt; [
                'callback' =&gt; 'custom_api_create_users',
                'access callback' =&gt; 'custom_api_access_callback',
                'access arguments' =&gt; array('administer create field_projects'),
                'access arguments append' =&gt; TRUE,
                'access callback file' =&gt; array(
                  'type' =&gt; 'inc',
                  'module' =&gt; 'support',
                  'name' =&gt; 'custom_api.resource',
                ),
                    'args' =&gt; [
                    [
                        'name' =&gt; 'data',
                        'type' =&gt; 'struct',
                        'description' =&gt; 'data',
                        'optional' =&gt; FALSE,
                        'source' =&gt; 'data'
                    ]
                ]


custom_api.resource.inc :

function custom_api_access_callback($permission) {
  return user_access($permission);
}


Permission from Database, role_permission table :

Permission : access comments
Module : comment

Permission : access content
Module : node

Permission : access news feeds
Module : aggregator

Permission : access site map
Module : site_map

Permission : create field_credits
Module : field_permissions

Permission : create field_credit_level_1
Module : field_permissions

Permission : create field_credit_level_2
Module : field_permissions

Permission : create field_credit_level_3
Module : field_permissions

Permission : create field_level
Module : field_permissions

Permission : create field_number_of_credit_remove
Module : field_permissions

Permission : create field_projects
Module : field_permissions

Permission : create field_remove_credit
Module : field_permissions

Permission : search content
Module : search

Permission : subscribe to newsletters
Module : simplenews

Permission : use advanced search
Module : search

Permission : use custom search
Module : custom_search

Permission : use custom search blocks
Module : custom_search_blocks

Permission : use text format guestbook_txt
Module : filter

Permission : access comments
Module : comment

Permission : access content
Module : node

Permission : access news feeds
Module : aggregator

Permission : access site map
Module : site_map

Permission : administer custom search
Module : custom_search

Permission : administer custom search blocks
Module : custom_search_blocks

Permission : administer search
Module : search



I have link to add data (client and node : project and client) in drupal website. Only administrators can add data.
Drupal Services is a bit strange in that it doesn't seem to fall back to calling the user_access() function. Instead, I always provide a custom access callback function, and in it usually just make a call to user_access(). Try this:

'doli' =&gt; [
        'create' =&gt; [
            'callback' =&gt; 'custom_api_create_user',
            'access callback' =&gt; 'example_access_callback',
            'access arguments' =&gt; array('administer access control'),
            'access arguments append' =&gt; TRUE,
            'access callback file' =&gt; array(
              'type' =&gt; 'inc',
              'module' =&gt; 'example',
              'name' =&gt; 'example.resource',
            ),
                'args' =&gt; [
                [
                    'name' =&gt; 'data',
                    'type' =&gt; 'struct',
                    'description' =&gt; 'data',
                    'optional' =&gt; FALSE,
                    'source' =&gt; 'data'
                ]
            ],
        ]
    ]


Then make a file called example.resource.inc in your module's folder, and place this code into it:

function example_access_callback($permission) {
  return user_access($permission);
}