Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Are there any hooks to alter the Services modules output. For eg : If I get a result like this for a file object.

{
  "fid": "132",
  "uri": "public:\/\/512dab4918036.jpg",
  "filename": "512dab4918036.jpg",
  "filemime": "image\/jpeg",
  "uid": "1",
  "status": 1,
  "timestamp": 1361947464,
  "filesize": 2521,
}

I want to limit it for users with certain roles.

I am looking for this as I have made many services resource manually so I don't want to edit them all and simply use the output alter hook to do something.

Is it possible ?

share|improve this question
    
What exactly do you want to do ? Remove some of the fields in the file object ? –  drcelus Feb 27 '13 at 13:45
    
@drcelus no i want to deliver a default output if user dont met certain criteria. –  Nikhil M Feb 27 '13 at 14:13

1 Answer 1

up vote 2 down vote accepted

The available hooks for Services are documented in the api docs for services

You probably want hook_services_request_postprocess_alter($controller, $args, $result); which allows you to change the array of $result any way you want.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.