It's all about the answers!

Ask a question

Is there any possibility to change created by attribute in GCM Component using APIs?


Thiruvenkadam Dhanaraj (27216) | asked Feb 22 '22, 12:59 a.m.

 Hi,


Is there any possibility to change the created by value of GCM Component using API?
We have a special requirement, GCM Components are created using Rest API and it automatically takes the user information from Jazz server and updates the "Created by" value with the user name 

But for our usecase the App user (One who is logged in to integrated application) should be restricted to create Components in GCM instead "system user" is allowed to create Components so we need to have username in Created By as App user. 

For this we tried to do POST call using "system user" credentials and created by value is updated with system user but we need to show App username in GCM.

Is that possible from GCM Api to update the created by value?

Thank you in advance,
Thiru


Comments
Ian Barnard commented Feb 22 '22, 3:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

No it isn't possible to change the created by property 

Accepted answer


permanent link
David Honey (1.8k17) | answered Feb 22 '22, 4:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

No, that is not possible. As Ralph commented above, dcterms:created is intentionally considered a read-only attribute and cannot be modified with an HTTP PUT. This is considered best practice for audit reasons.The resource shape for a global configuration defines the dcterms:created property as:

      oslc:property
              [ a       oslc:Property ;
                oslc:name "Date Created" ;
                oslc:occurs oslc:Exactly-one ;
                oslc:propertyDefinition
                        dcterms:created ;
                oslc:queryable "true"^^xsd:boolean ;
                oslc:readOnly "true"^^xsd:boolean ;
                oslc:valueType xsd:dateTime ;
                dcterms:title "Date Created"^^rdf:XMLLiteral
It says that property is read-only.

Best regards,
David


Ralph Schoon selected this answer as the correct answer

2 other answers



permanent link
Ralph Schoon (63.0k33645) | answered Feb 22 '22, 2:27 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 In my mind, it should not be possible to modify data such as CreatedBy, Creation Date, ModifiedBy, Modified etc. this would clash with Audit capability and truth of the data. I have not been able to modify those values in any Jazz application I have tried with whatever API I tried. I believe I have seen EWM/RTC integrations being able to set these values for the initial creation, but I do not know which API they used. There might be a special hidden API that allows this. Once created, these values should not be modifiable.


permanent link
David Honey (1.8k17) | answered Feb 22 '22, 4:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The same applies to dcterms:creator :

      oslc:property
              [ a       oslc:Property ;
                oslc:name "Creator" ;
                oslc:occurs oslc:Exactly-one ;
                oslc:propertyDefinition
                        dcterms:creator ;
                oslc:queryable "true"^^xsd:boolean ;
                oslc:range foaf:Person ;
                oslc:readOnly "true"^^xsd:boolean ;
                oslc:valueType oslc:Resource ;
                dcterms:title "Creator"^^rdf:XMLLiteral
              ] ;

Your answer


Register or to post your answer.