Access/ Manipulate #__assets.rules 1283 PostsBucklash 7 years ago7Topic Hi folks At the risk of sounding lazy, Has anyone got an example of how to access and manipulate #__assets.rules, ie in a beforestore event? An example of the field I am talking about would be ' art_rules', It's field 393, FYI.... Any examples would be great like change {"core.admin":{"7":1},"core.manage":{"7":1}} to... <br> ...this {"core.admin":{"12":1},"core.manage":{"5":1},"core.funky":{"12":1}} Thanks or any tips 4229 PostsKadministrator 7 years ago6Level 1asset rules are json encoded so you would need to read it, unpack it, manipulate reulting object, it encode back to json and store. 1283 PostsBucklash 7 years ago5Level 2Hi KlasThanks for that. 1283 PostsBucklash 7 years ago4Level 3To make sure you grab a string from db and process it using JSON yo have to wrap the string in double quotes.I grabbed a #__assets.rule value from db using sql query for live value on the art_alias field.I then wrapped this value in double quotes to achieve success$alias = '"'.$fields['art_alias']->value.'"'; $jsonalias = json_decode($alias); var_dump($jsonalias); 1283 PostsBucklash 7 years ago3Level 4HelloBack to this again...So using JCckContentJoomla_Article.... is 'rules' applicable there?:$newData = new JCckContentJoomla_Article; $addData = $newData->create( 'some_content_type', $columns( 'title' => 'My Title, .... 'rules' => '{"core.delete":[],"core.edit":[],"core.edit.state":[]}' ), $columnsMore(stuff...), $columnsMore2(stuff...) ); If it is, I am not sure what I am doing incorrectly, I end up with '{}' no matter what and I have checked that do have a JSON string to store.... hmmm 4229 PostsKadministrator 7 years ago2Level 5try passing it as an object, not as json string 1283 PostsBucklash 7 years ago1Level 6Hi KlasTried that and no joy... if it is not a possibility at least I knowJon 1283 PostsBucklash 7 years ago0Level 7assign-value-to-rules