Adding "created_by" in /content/create

More
7 years 5 months ago #65 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).

Please Log in or Create an account to join the conversation.

  • stevetsi@gmail.com
  • stevetsi@gmail.com's Avatar
7 years 5 months 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.

Please Log in or Create an account to join the conversation.

More
7 years 5 months 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.
The following user(s) said Thank You: dbode

Please Log in or Create an account to join the conversation.

More
7 years 5 months 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');
}

Please Log in or Create an account to join the conversation.

More
7 years 5 months 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.
The following user(s) said Thank You: dbode

Please Log in or Create an account to join the conversation.

Cron Job Starts