Comments (3)
I would also like to get a handle on the custom method execution.
From the code - it defers the method to the allowed_actions within the $authority (which by default is the RESTful_API_DefaultPermissionManager. Is that by design? The permission manager is responsible for delegating out the actions/methods to their final destination?
from silverstripe-restfulapi.
I'd like some help with this aswell
from silverstripe-restfulapi.
@zegerman @TihoBeretovac @sanderha sorry for not replying earlier...
it all depends what you are trying to achieve... if you have methods on some Controller you had like to access, this is already built in SS, you should be able to access it through the route ControllerName/method
or setup a custom route to use something else than the controller name in the route.
If you want the result of your custom method to be serialized, you can always instantiate the Serializer in your custom method.
if you want your Controller methods to be accessed through the api/...
route. This will need more work. You would have to extend the main API class with your own and edit the config of the new RESTfulAPI class, adding your own entry in $dependencies
and the public property that match so the controller is instantiated. Then also add your own entry in allowed_actions and url_handlers. Then create the method that match your definition on url_handlers to access your controller and pass on the request to your own controller where the method is.... so overall, more complicated.
@TihoBeretovac the permission manager is used to check is the user accessing the api has the right to read, edit etc the model being accessed. Through the canView
etc methods. Nothing more at the moment. The acl
method on RestfulAPI is there just in case, for example if someone create a custom permission manager and needs to access some methods on it via the api. But at the minute or with the default, it's not in use.
from silverstripe-restfulapi.
Related Issues (20)
- Embedded Records not working as expected, or at all HOT 2
- Pagination for the Json
- The full configuration for BlogCategories & FeaturedImage
- Setting tokenOwnerClass HOT 2
- password with special characters HOT 1
- Response code 100 when post object has more than 3 relations
- CORS not working - Question really HOT 1
- api/auth/lostPassword -> BadMethodCallException
- New release? HOT 1
- Created, LastEdited never seem to be returned HOT 3
- Specify fields to be returned HOT 2
- default limit? HOT 1
- Access to token on dataobjects HOT 2
- Why convert properties and model names by "lcfirst"? HOT 1
- Lost password existing account disclosure HOT 4
- Can I call multiple dataobject in one api request and response in one json object?
- How to prevent POST requests specifying ID HOT 1
- SilverStripe 4 Support HOT 1
- model_permission_check instanceof Member not namespaced HOT 1
- Getting error: Call to undefined method SilverStripe\Config\Collections\CachedConfigCollection::set()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from silverstripe-restfulapi.