Check this. The idea is that if a user logs in to a system with a classification other than "BPPA", the CK editor should be disabled and read-only. If the user classification is BPPA, the CK editor can be edited. Note that these fractional parts of the code are actually in PHP. They need a working database to work, but I thought you could get this idea and be able to work with your magic.
<?php //This line is to disable PART A if classification != 'BPPA' $bppa = mysql_query("SELECT * from roles WHERE username = '$_SESSION[username]'"); $bppa_row = mysql_fetch_array($bppa); if($bppa_row['classification'] != 'BPPA'){ $disabled = 'disabled = "disabled"'; }else{ $disabled = ""; } //ends here ?>
Then apply $ disable to your text area:
<?php echo '<textarea class="ckeditor" '.$disabled.' name="content' . $n . '" id="content' . $n . '">' . $saved . '</textarea>'; ?>
source share