Get and Create Item Data Security

You can use the Product Management Data Securities resource to create and manage data security for Product Management objects just as you would in the user interface.

Let's discuss these scenarios, where say James is a product data steward who is preparing the production system for going live, and then uses REST API to:

  1. Get data security grant was created during testing

  2. Post a new data security grant for the production users

  3. Delete a data security grant that was created during testing

Get Item Data Security Grant

During testing the data security grants were created for the test users and these grants will now be used to create new data security grants for each of the production users. The test user name is James and an item data security grant was created for item AS1234. In this scenario, you can get the item data security grants that were created for this item.

Example URL

Use this resource URL format.

GET

curl -u username:password "https://servername/fscmRestApi/resources/version/productManagementDataSecurities?q=ObjectName=Item;Principal=Person;Name=James.Dean;ItemNumber=AS1234;OrganizationCode=V1"

This table shows the values that the application collects from the response payload and displays in fields in the test application.

Attribute Description
ObjectName The object for the data grant.
Principal The user or group for the data grant.
Name Value that uniquely identifies a supplier.
ItemNumber The number for an item used in a data grant.
OrganizationCode The organization code for the data grant.

Example Response

Here's an example of the response body in JSON format.

{
  "items": [
    {
      "ObjectName": "Item",
      "GrantId": "90309F0A6E646265E05321BDF20A5839",
      "InstanceType": "INSTANCE",
      "Principal": "Person",
      "Name": "James.Dean",
      "Description": null,
      "StartDate": "2019-08-15",
      "EndDate": null,
      "OrganizationCode": "V1",
      "ItemClass": null,
      "InheritedItemClass": null,
      "ItemNumber": "AS1234",
      "InheritedFlag": "false",
      "TradingPartnerName": null,
      "TradingPartnerItemType": null,
      "TradingPartnerItemNumber": null,
      "Actions": "Delete | Maintain Item Asset Maintenance Group | Maintain Item Attribute | Maintain Item Basic | Maintain Item Costing Group | Maintain Item General Planning Group | Maintain Item Inventory Group | Maintain Item Invoicing Group | Maintain Item Lead Times Group | Maintain Item MRP and MPS Group | Maintain Item Order Management Group | Maintain Item Pack | Maintain Item People | Maintain Item Physical Group | Maintain Item Primary Group | Maintain Item Process Manufacturing Group | Maintain Item Purchasing Group | Maintain Item Receiving Group | Maintain Item Revision | Maintain Item Service Group | Maintain Item Structure | Maintain Item Structure Group | Maintain Item Web Option Group | Maintain Item Work in Process Group | Read | Update | View Item Attribute | View Item Basic | View Item Pack | View Item Structure",
      "ItemEFFActions": null,
      "ItemEFFTranslationActions": null,
      "ItemRevisionEFFActions": null,
      "ItemRevisionEFFTranslationActions": null,
      "ItemSupplierEFFActions": null,
      "ItemSupplierEFFTranslationActions": null,
      "links": [
        {
          "rel": "self",
          "href": "https://servername/fscmRestApi/resources/version/productManagementDataSecurities/0002000000044974656D000000203930333039463041364536343632363545303533323142444632304135383339",
          "name": "productManagementDataSecurities",
          "kind": "item"
        },
        {
          "rel": "canonical",
          "href": "https://servername/fscmRestApi/resources/version/productManagementDataSecurities/0002000000044974656D000000203930333039463041364536343632363545303533323142444632304135383339",
          "name": "productManagementDataSecurities",
          "kind": "item"
        },
        {
          "rel": "child",
          "href": "https://servername/fscmRestApi/resources/version/productManagementDataSecurities/0002000000044974656D000000203930333039463041364536343632363545303533323142444632304135383339/child/ItemClassPVO",
          "name": "ItemClassPVO",
          "kind": "collection"
        },
        {
          "rel": "child",
          "href": "https://servername/fscmRestApi/resources/version/productManagementDataSecurities/0002000000044974656D000000203930333039463041364536343632363545303533323142444632304135383339/child/ItemPVO",
          "name": "ItemPVO",
          "kind": "collection"
        },
        {
          "rel": "child",
          "href": "https://servername/fscmRestApi/resources/version/productManagementDataSecurities/0002000000044974656D000000203930333039463041364536343632363545303533323142444632304135383339/child/ObjectLookupPVO",
          "name": "ObjectLookupPVO",
          "kind": "collection"
        },
        {
          "rel": "child",
          "href": "https://servername/fscmRestApi/resources/version/productManagementDataSecurities/0002000000044974656D000000203930333039463041364536343632363545303533323142444632304135383339/child/PmItemPVO",
          "name": "PmItemPVO",
          "kind": "collection"
        },
        {
          "rel": "child",
          "href": "https://servername/fscmRestApi/resources/version/productManagementDataSecurities/0002000000044974656D000000203930333039463041364536343632363545303533323142444632304135383339/child/PrincipalLookupPVO2",
          "name": "PrincipalLookupPVO2",
          "kind": "collection"
        },
        {
          "rel": "child",
          "href": "https://servername/fscmRestApi/resources/version/productManagementDataSecurities/0002000000044974656D000000203930333039463041364536343632363545303533323142444632304135383339/child/RcsOrgDefinitionsLWPVO",
          "name": "RcsOrgDefinitionsLWPVO",
          "kind": "collection"
        },
        {
          "rel": "child",
          "href": "https://servername/fscmRestApi/resources/version/productManagementDataSecurities/0002000000044974656D000000203930333039463041364536343632363545303533323142444632304135383339/child/RolePVO",
          "name": "RolePVO",
          "kind": "collection"
        },
        {
          "rel": "child",
          "href": "https://servername/fscmRestApi/resources/version/productManagementDataSecurities/0002000000044974656D000000203930333039463041364536343632363545303533323142444632304135383339/child/UserPVO",
          "name": "UserPVO",
          "kind": "collection"
        }
      ]
    }
  ],
  "count": 1,
  "hasMore": false,
  "limit": 25,
  "offset": 0,
  "links": [
    {
      "rel": "self",
      "href": "https://servername/fscmRestApi/resources/version/productManagementDataSecurities",
      "name": "productManagementDataSecurities",
      "kind": "collection"
    }
  ]
}

Create a New Item Data Security Grant

James wants to create a data grant for a Jane Powel a production user based on the data grant the test user has. In this scenario, James creates a new product upload using the POST operation.

Example URL

Use this resource URL format.

POST

curl -u username:password -X POST -H "Content-Type:application/vnd.oracle.adf.resourceitem+json" -d 'request payload' 
"https://servername/fscmRestApi/resources/version/productManagementDataSecurities" -H 'cache-control: no-cache'

Example Request

Here's an example of the request body in JSON format.

{
	"ObjectName":"Item",
	"Principal":"Person",
	"OrganizationCode":"V1",
	"ItemNumber":" AS1234",
	"Name":" Jane.Powel ",
	"Actions": "Delete | Maintain Item Asset Maintenance Group | Maintain Item Attribute | Maintain Item Basic | Maintain Item Costing Group | Maintain Item General Planning Group | Maintain Item Inventory Group | Maintain Item Invoicing Group | Maintain Item Lead Times Group | Maintain Item MRP and MPS Group | Maintain Item Order Management Group | Maintain Item Pack | Maintain Item People | Maintain Item Physical Group | Maintain Item Primary Group | Maintain Item Process Manufacturing Group | Maintain Item Purchasing Group | Maintain Item Receiving Group | Maintain Item Revision | Maintain Item Service Group | Maintain Item Structure | Maintain Item Structure Group | Maintain Item Web Option Group | Maintain Item Work in Process Group | Read | Update | View Item Attribute | View Item Basic | View Item Pack | View Item Structure",
	"ItemEFFTranslationActions": "",
	"ItemRevisionEFFActions": "",
	"ItemRevisionEFFTranslationActions": "",
	"ItemSupplierEFFActions": "",
	"ItemSupplierEFFTranslationActions": ""

}

Example Response

Here's an example of the response body in JSON format.

{
	"items:" [
	{
		"ObjectName": "Item",
		"GrantId": "8E991EE8F7640326E053A15AF00A956A",
		"InstanceType": "INSTANCE",
		"Principal": "Person",
		"Name": " Jane.Powel ",
		"Description": null,
		"StartDate": "2019-11-27",
		"EndDate": null,
		"OrganizationCode": "V1",
		"ItemClass": "ALLQA",
		"InheritedItemClass": null
		"ItemNumber": "AS1234",
		"InheritedFlag": false,
		"TradingPartnerName": null,
		"TradingPartnerItemType": null,
		"TradingPartnerItemNumber": null,
		"Actions": "Delete | Maintain Item Asset Maintenance Group | Maintain Item Attribute | Maintain Item Basic | Maintain Item Costing Group | Maintain Item General Planning Group | Maintain Item Inventory Group | Maintain Item Invoicing Group | Maintain Item Lead Times Group | Maintain Item MRP and MPS Group | Maintain Item Order Management Group | Maintain Item Pack | Maintain Item People | Maintain Item Physical Group | Maintain Item Primary Group | Maintain Item Process Manufacturing Group | Maintain Item Purchasing Group | Maintain Item Receiving Group | Maintain Item Revision | Maintain Item Service Group | Maintain Item Structure | Maintain Item Structure Group | Maintain Item Web Option Group | Maintain Item Work in Process Group | Read | Update | View Item Attribute | View Item Basic | View Item Pack | View Item Structure",
		"ItemEFFActions": null,
		"ItemRevisionEFFActions": null,
		"ItemRevisionEFFTranslationActions": null,
		"ItemSupplierEFFActions": null,
		"ItemSupplierEFFTranslationActions": null,
Links: [
		{"rel": "self", "href": "https://servername/fscmRestApi/resources/version/productManagementDataSecurities/0002000000044974656D000000203845393931454538463736343033323645303533413135414630304139353641",…
		}]
	}
	]
}

Multipart Creation of Item Data Security Grant

When James wants create item data grants for multiple production users, the multipart POST operation can be used.

Example URL

Use this resource URL format.

POST

curl -u username:password -X POST -H "Content-Type:application/vnd.oracle.adf.batch+json" -d 'request payload' 
"https://servername/fscmRestApi/resources/version" -H 'cache-control: no-cache'

Example Request

Here's an example of the request body in JSON format in which case two data grants are created for an item.

{
	"parts": [
	{
		"id": "part1",
		"path": "/productManagementDataSecurities",
		"operation": "create",
		"payload": {
			"ObjectName":"Item",
			"Principal":"Person",
			"Name":"Kelly.Smith",
			"OrganizationCode":"V1",
			"ItemNumber": "AS1234",
			"Actions": "Delete | Maintain Item Asset Maintenance Group | Maintain Item Attribute | Maintain Item Basic | Maintain Item Costing Group | Maintain Item General Planning Group | Maintain Item Inventory Group | Maintain Item Invoicing Group | Maintain Item Lead Times Group | Maintain Item MRP and MPS Group | Maintain Item Order Management Group | Maintain Item Pack | Maintain Item People | Maintain Item Physical Group | Maintain Item Primary Group | Maintain Item Process Manufacturing Group | Maintain Item Purchasing Group | Maintain Item Receiving Group | Maintain Item Revision | Maintain Item Service Group | Maintain Item Structure | Maintain Item Structure Group | Maintain Item Web Option Group | Maintain Item Work in Process Group | Read | Update | View Item Attribute | View Item Basic | View Item Pack | View Item Structure",
			"ItemEFFActions": "",
			"ItemEFFTranslationActions": "",
			"ItemRevisionEFFActions": "",
			"ItemRevisionEFFTranslationActions": "",
			"ItemSupplierEFFActions": "",
			"ItemSupplierEFFTranslationActions": ""
		}
	},
	{
		"id": "part2",
		"path": "/productManagementDataSecurities",
		"operation": "create",
		"payload": {
			"ObjectName":"Item",
			"Principal":"Person",
			"Name":"Geoge.Ello",
			"OrganizationCode":"V1",
			"ItemNumber": " AS1234",
			"Actions": "Delete | Maintain Item Asset Maintenance Group | Maintain Item Attribute | Maintain Item Basic | Maintain Item Costing Group | Maintain Item General Planning Group | Maintain Item Inventory Group | Maintain Item Invoicing Group | Maintain Item Lead Times Group | Maintain Item MRP and MPS Group | Maintain Item Order Management Group | Maintain Item Pack | Maintain Item People | Maintain Item Physical Group | Maintain Item Primary Group | Maintain Item Process Manufacturing Group | Maintain Item Purchasing Group | Maintain Item Receiving Group | Maintain Item Revision | Maintain Item Service Group | Maintain Item Structure | Maintain Item Structure Group | Maintain Item Web Option Group | Maintain Item Work in Process Group | Read | Update | View Item Attribute | View Item Basic | View Item Pack | View Item Structure",
			"ItemEFFActions": "",
			"ItemEFFTranslationActions": "",
			"ItemRevisionEFFActions": "",
			"ItemRevisionEFFTranslationActions": "",
			"ItemSupplierEFFActions": "",
			"ItemSupplierEFFTranslationActions": ""
		}
	}
	]
}

Example Request

Here's an example of the request body in JSON format in which case one data grants is created and one data grant is updated for an item.

"parts": [
{
	"id": "part1",
	"path": "/productManagementDataSecurities/0002000000044974656D000000203934323937343733433930423233354545303533333942324632304139424537",
	"operation": "update",
	"payload": {
		"StartDate":"2019-11-04",
		"EndDate": "2019-11-04"
		
	}
},
{
	"id": "part2",
	"path": "/productManagementDataSecurities",
	"operation": "create",
	"payload": {
		"ObjectName":"Item",
		"Principal":"Group",
		"Name":"Product Manager",
		"StartDate":"2019-11-08",
		"EndDate": "2019-11-08",
		"OrganizationCode":"V1",
		"ItemClass": "Electronics",
		"Actions": "View Item Structure | Create Item Class Item | Maintain Item Asset Maintenance Group | Maintain Item Attribute | Maintain Item Costing Group | Maintain Item Order Management Group",
		"ItemEFFActions": "CDRM_Edit_P4FA_Item_EFF_NT|CDRM_View_P4FA_Item_EFF_NT",
		"ItemEFFTranslationActions": "PT_EFF_View_Priv_1|PT_EFF_Edit_Priv_1|PT_EFF_View_Priv|PT_EFF_Edit_Priv",
		"ItemRevisionEFFActions": "",
		"ItemRevisionEFFTranslationActions": "",
		"ItemSupplierEFFActions": "CDRM_Edit_P4FA_ItemSuppl_EFF_NT|CDRM_View_P4FA_ItemSuppl_EFF_NT",
		"ItemSupplierEFFTranslationActions": ""
	}
}
]
}

Multipart Creation of Item Data Security Grant

In cases where James wants create item data grants for multiple production users, but is unsure if the data grant exists and if the data grant exists then he wants to update it, otherwise create the new data grant, the multipart POST operation with the Upsert operation can be used.

{
	"parts": [
	{
		"id": "part1",
		"path": "/productManagementDataSecurities",
		"operation": "upsert",
		"payload": {
			"ObjectName":"Item",
			"Principal":"Person",
			"Name":"Dave.Jones",
			"Description":"new desc",
			"EndDate": "2020-09-30",
			"OrganizationCode":"V1",
			"ItemNumber": "AS423878",
			"Actions": "View Item Structure | Maintain Item Asset Maintenance Group | Maintain Item Attribute | Maintain Item Costing Group | Maintain Item Order Management Group",
			"ItemEFFActions": "",
			"ItemEFFTranslationActions": "",
			"ItemRevisionEFFActions": "",
			"ItemRevisionEFFTranslationActions": "",
			"ItemSupplierEFFActions": "",
			"ItemSupplierEFFTranslationActions": ""
		}
	},
	{
		"id": "part2",
		"path": "/productManagementDataSecurities",
		"operation": "upsert",
		"payload": {
			"ObjectName":"Item",
			"Principal":"Group",
			"Name":"Product Manager",
			"Description":"new desc",
			"EndDate": "2020-09-30",
			"OrganizationCode":"V1",
			"ItemNumber": "ASB12N",
			"Actions": "View Item Structure | Maintain Item Asset Maintenance Group | Maintain Item Attribute | Maintain Item Costing Group | Maintain Item Order Management Group",
			"ItemEFFActions": "",
			"ItemEFFTranslationActions": "",
			"ItemRevisionEFFActions": "",
			"ItemRevisionEFFTranslationActions": "",
			"ItemSupplierEFFActions": "",
			"ItemSupplierEFFTranslationActions": ""
		}
	}
	]
}

DELETE Item Data Security Grant

Now that testing is completed, the original data grant that was created for James is no longer needed and can be deleted from the system. The data grant for AS123 can be deleted. James can first use GET action to query for the item, then use the self-link with the action changed to DELETE.

Example URL

Use this resource URL format.

DELETE

curl -u username:password -X DELETE "https://servername/fscmRestApi/resources/version/productManagementDataSecurities/0002000000044974656D000000203930333039463041364536343632363545303533323142444632304135383339"

Example Response

status code : 204 for successful deletion of grant.