S
S
Stopy2016-04-13 20:24:50
Yii
Stopy, 2016-04-13 20:24:50

How to restrict access to REST?

How to restrict access to a PUT request to a resource in a rest application, if I want only its author to change the record. Where can I write my own rules for access?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Natarov, 2016-04-13
@Stopy

Save the author's id. check the requested entry in BeforAction and look at the author's Id.
Most likely, your authors are tied to User, you can pull out the current usera id like this
.
So I do, but MB will tell you, an even better option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question