- Posts: 24
Adding "created_by" in /content/create
- dbode
- Topic Author
- Offline
Less
More
8 years 1 month ago #65
by dbode
Adding "created_by" in /content/create was created by dbode
Hi,
in this file
./plugins/services/joomla/joomla/content.php
I added this line @ 261
$article->created_by = $app->request->params('created_by');
If I don't do that, created articles *always* are created by the api user assigned to the used token. However, this might be not the desired behaviour, so if you add this line it's possible to send the "created_by" key to set the author id properly.
If you're not passing that value, the token assigned api user will be used (as it works actually).
in this file
./plugins/services/joomla/joomla/content.php
I added this line @ 261
$article->created_by = $app->request->params('created_by');
If I don't do that, created articles *always* are created by the api user assigned to the used token. However, this might be not the desired behaviour, so if you add this line it's possible to send the "created_by" key to set the author id properly.
If you're not passing that value, the token assigned api user will be used (as it works actually).
Please Log in to join the conversation.
- stevetsi@gmail.com
8 years 1 month ago #66
by stevetsi@gmail.com
Replied by stevetsi@gmail.com on topic Adding "created_by" in /content/create
Sounds great!
I wasn't sure if there would be a need to uniquely define the create_by user so it wasn't included at first. Also, one needs to be careful with permissions in the regard so you don't have a "Manager" creating content on behalf of a "Super User". This is easy enough to resolve though so it can be included in the upcoming release. I just have to make sure it's properly secured.
I wasn't sure if there would be a need to uniquely define the create_by user so it wasn't included at first. Also, one needs to be careful with permissions in the regard so you don't have a "Manager" creating content on behalf of a "Super User". This is easy enough to resolve though so it can be included in the upcoming release. I just have to make sure it's properly secured.
Please Log in to join the conversation.
- steve.tsiopanos
- Offline
Less
More
- Posts: 163
8 years 1 month ago #67
by steve.tsiopanos
Replied by steve.tsiopanos on topic Adding "created_by" in /content/create
I will move forward with include the created_by field for the following method:
POST /content/create
I will hold on including the ability to modified the created_by field in PUT /content/update/:id for a later version.
POST /content/create
I will hold on including the ability to modified the created_by field in PUT /content/update/:id for a later version.
The following user(s) said Thank You: dbode
Please Log in to join the conversation.
- dbode
- Topic Author
- Offline
Less
More
- Posts: 24
8 years 1 month ago #68
by dbode
Replied by dbode on topic Adding "created_by" in /content/create
Please also add "modified_by" field for /content/update/:id
same file, add around line 450:
if($app->request->params('modified_by')) {
$article->modified_by = $app->request->params('modified_by');
}
same file, add around line 450:
if($app->request->params('modified_by')) {
$article->modified_by = $app->request->params('modified_by');
}
Please Log in to join the conversation.
- steve.tsiopanos
- Offline
Less
More
- Posts: 163
8 years 1 month ago #71
by steve.tsiopanos
Replied by steve.tsiopanos on topic Adding "created_by" in /content/create
"Please also add "modified_by" field for /content/update/:id"
This has been included in development for cAPI v1.2.7.
This has been included in development for cAPI v1.2.7.
The following user(s) said Thank You: dbode
Please Log in to join the conversation.