Read-only fields in material design

I am wondering how to style the fields in a form for users that have read-only access.

As per MD guidlines read only fields should have help text stating read-only. However in the situation where to whole form is read only as user can only view it how should I style them?

Should I use disabled field styling? Or should I remove the outlined borders?( I am using outlined type of material design fields).


Как привязать свойство readonly к input, которое будет зависеть от чекбокса?

Доброго времени суток!

Пытаюсь сделать реактивную форму, в которой один из инпутов может иметь свойство readonly в завсимости от состояния чекбокса – если чекбокс выбран, инпут доступен для ввода текста, если не выбран, инпут ридонли.


import {FormControl, FormGroup, Validators} from "@angular/forms";  @Component({   selector: 'app-add-topic',   templateUrl: './add-topic.component.html',   styleUrls: ['./add-topic.component.css'] }) export class AddTopicComponent implements OnInit {    constructor() { }    addTopicForm: FormGroup;    ngOnInit() {     this.initForm();   }    initForm(): void {     this.addTopicForm = new FormGroup({       'tabName': new FormControl(null, Validators.required),       'indicatorName': new FormControl(null, Validators.required)     });   } } 


<form class="addTopic modal"       [formGroup]="addTopicForm">     <div class="project-label">Добавление топика</div>     <div class="controls form-group">       <label for="tabName">Название</label>       <input type="text"              id="tabName"              formControlName="tabName">       <label for="indicatorName">Индикатор</label>       <span><input type="checkbox" id="isIndicator" #isInd checked></span>       <input type="text"              id="indicatorName"              [readonly]="!isInd.checked"              formControlName="indicatorName">     </div> </form> 

Собственно, так вроде работает, но свойство readonly ставится от балды через раз (вне зависимости от состояния чекбокса, надо несколько раз сменить состояние чекбокса, чтобы у инпута появилось нужное свойство). Что я делаю не так?

Is there a file system allowing read-only access enforced by cryptography

Is there a file system standard (like LUKS) that allows anyone who can plug in the hard drive to read files, but requires a passphrase to modify or write? For example, I can do something similar by signing an unencrypted file with gpg whenever I save it.

I admit it’s impossible to prevent a malicious OS from modifying the files anyway. Therefore I’m looking for a file system that can detect malicious changes in such a way that an attacker without the passphrase cannot simulate an authorized change without breaking a modern cryptographic function.

Security risks of Read-only MySQL Database access behind firewall

Are there any obvious security risks to providing a none IT Staff member read-only Database access (through MySQL Workbench) to a WordPress Database, if this is behind a firewall/VPN?

This WordPress database would contain various Woocommerce related personal information e.g user accounts, orders etc.

This password would also be sent via none secure methods e.g email / skype

Sharepoint sync sets every document to read-only

I’ve made some adjustments to the library we are using, but now users can’t direct edit the items in the desktop. However, I can.

They see the following:

  • Green locks on every document
  • When they open a document its in read-only mode
  • When they try to upload a new document they are asked for administrator rights.

enter image description here

How do I fix this? So that every user is able again to edit and upload documents on the fly.

Thank you.

Unable to modify file permissions.xml, get error Read-only file system

I have a rooted Galaxy S5 SM-G900V, lineage_klte, ARMv7 Processor rev 1 (v71), Kernel: 3.4.113-lineageos #1 SMP, Oreo 8.1 that a friend asked me to modify.

I need to modify the platform.xml file to allow the system to write data to the external sd card. I need the ability to modify this file. The current permissions are: rw-r–r– 1 root root, however I am unable to save any modifications.

I am unable to modify the file permissions and would like to know how to do so. Note, I am looking how to change the file permissions and not how to or what syntax to use in the xml file, or if it will allow me to have the system recognize the external sd card for saving data. I am perplexed on why I am unable to modify this file.

> adb devices  <-- verify I have the device > adb shell    <-- enter shell > su           <-- super user # ls -l drwxr-xr-x  17 root   root      4096 2019-03-20 10:26     system # cd system #ls -l drwxr-xr-x 20 root root     4096 2019-03-20 10:25 etc # cd etc  # ls -l  > drwxr-xr-x  2 root root     560 2013-12-31 21:23 permissions  # cd permissions  # ls -l  -rw-r--r-- 1 root root  9116 2008-12-31 18:00 platform.xml  # chmod 755 platform.xml  >> chmod: chmod 'platform.xml' to 100755: Read-only file system 

So, how do I change the file attributes for platform.xml allowing it to be modified? I thought that there was a hidden immutable attribute on the file but there is not(at least that I can determine).

Related question, is there any other website to post this question? Any help is most appreciated.

ref readonly struct field VS regular readonly struct property?

I am implementing the Unit type (like in F# and other functional languages) in C#, I drafted the code below:

public readonly struct Unit : IEquatable<Unit> {     public static readonly Unit Default = new Unit();      public override int GetHashCode() =>          0;      public override bool Equals(object obj) =>         obj is Unit;      public bool Equals(Unit other) =>         true;      public static bool operator ==(Unit left, Unit right) =>         true;      public static bool operator !=(Unit left, Unit right) =>         false; } 

However, I found another implementation which is pretty similar to mine:

public readonly struct Unit : IEquatable<Unit> {     private static Unit _default = default;     public static ref readonly Unit Default => ref _default;      public bool Equals(Unit other) => true;     public override bool Equals(object obj) => obj is Unit;     public override int GetHashCode() => 0;     public static bool operator ==(in Unit first, in Unit second) => true;     public static bool operator !=(in Unit first, in Unit second) => false; } 

As you can see the main difference lies in the Default property implementation, I am wondering if there is any benefit on the second implementation which leverage the ref keyword.

If there is a lot of Unit.Default use in a codebase is it gonna save up a lot of memory / GC ticks?

Or is it just a micro optimization which is not worth it since a struct is gonna be de-allocated anyway at the end of the method which actually uses it?

How to create a custom macOS Mojave 10.14 read-only boot volume?

5 or 10 years ago it was common for people to create customized bootable OS X .iso or .dmg images & burn them to CD or DVD, mostly for hard disk data recovery purposes. There were quite a few articles from that era detailing the process of customizing OS X to successfully boot and have a fully-featured GUI while in read-only mode.

With the decline of CD/DVD burning generally I haven’t found much currently info about making customized, bootable, read-only macOS Mojave installs.

Here’s what I want:

  • A fully-operational macOS Mojave Startup Disk (not an installer) on a read-only hard drive or USB stick. (I have a true read-only-capable USB thumb drive.)

  • I want to be able to log in normally, use Finder normally, and launch basic apps like TextEdit or a web-browser.

In my testing so far, I have tried using Carbon Copy Cloner to clone my normal boot drive to my special configurable Read/Write + Read/Only USB thumb drive.

In normal R/W mode the USB stick boots as expected, all the way to the Desktop/Finder.

When I set the USB stick to R/O (read-only), the same macOS 10.14 config starts to boot, but about 10% of the way through the boot progress bar (before any user-login prompt appears,) the Mac (a 2018 MacBook Pro) just powers off with no warning.

Any tips, suggestions, or pointers to on-line guides for getting this working?

scp – read-only file system – gz brokes my disk [on hold]

I have an Oracle Linux as an initiator of an iSCSI connection to a Windows target. This is the new environment for a migration. Everything’d worked fine until I tried to migrate the test database. For some reason, when i run “scp -C ./test.dmp.gz root@IP:/mount/point”, the mounted disk turns to “read-only filesystem” and i can’t perform any action on it. The only way to restore the disk is rebooting the server and doing “umount” / “mount”. I tried to move another files and i had no problem. Could it be the “gz” format? Could it be the size of the file? (3Gb) Thanks in advance

¿Cómo reutilizo un formulario y aplico `readOnly` a ciertos campos segun la funcion a usar?

Tengo que reutilizar un formulario en tres funciones que harán cosas diferentes, en la primera utilizaré todos los campos del formulario, en la segunda algunos campos tendran que estar como readOnly, y la tercera mostrará en los campos el valor de cada atributo del objeto y estarán todos como readOnly y no se como hacerlo, probé con if else, y no fui capaz y ahora lo modifiqué para dejar un `switch“que parece mas limpio pero tampoco logro llamar a las funciones. el codigo es el siguiente:

window.addEventListener('load', iniciar);  function iniciar() { 	document.getElementById("usuarios").addEventListener('click',botones); 														   }  //botones para llamar alta, modificar, baja usuarios. function botones(event){ 	event.preventDefault(); 	document.getElementById('cuerpo').innerHTML='<div class="botones">'+ 		'<form id="opcionesBoton" action="index.html" method="get">'+ 		'<input type="submit" name="alta" class="opcion" value="alta">'+ 		'<input type="submit" name="modificar" class="opcion" value="modificar">'+ 		'<input type="submit" name="baja" class="opcion" value="baja">'+ 		'</form>'+		 		'</div>'; 		 		var opcion=document.getElementsByClassName('opcion').value; 		switch(opcion){				 					case 'alta': 			alert('1'); 			document.getElementById('cuerpo').innerHTML='<h1>opcion1</h1>';				 			document.getElementById("alta").addEventListener('click',alta); 			break; 		case 'modificar': 			alert('2'); 			document.getElementById('cuerpo').innerHTML='<h1>opcion2</h1>'; 			document.getElementById("modificar").addEventListener('click',modificarDatos); 			document.getElementById("fecNacimiento").readOnly=true; 			document.getElementById("fecNacimiento").readOnly=true; 			break; 		case 'baja': 			alert('3'); 			document.getElementById('cuerpo').innerHTML='<h1>opcion3</h1>'; 			document.getElementById("baja").addEventListener('click',baja); 			document.getElementById("nombre").readOnly=true; 			document.getElementById("apellido1").readOnly=true; 			document.getElementById("apellido2").readOnly=true; 			document.getElementById("dni").readOnly=true; 			document.getElementById("fecNacimiento").readOnly=true; 			document.getElementById("localidad").readOnly=true; 			document.getElementById("password").readOnly=true;	 			break; 		}; 	 }  function formulario(){     	document.getElementById('cuerpo').innerHTML='<div id="formulario">'+'<form action="index.html" id="formSocio" method="get"><br>'+											'<label for="name">Nombre</label><input type="text" id="nombre" name="nombre"><br>'+ 		'<label for="apellido1">Primer apellido</label><input type="text" id="apellido1" name="apellido1"><br>'+ 		'<label for="apellido2">Segundo apellido</label><input type="text" id="apellido2" name="apellido2"><br>'+ 		'<label for="dni">Dni</label><input type="text" id="dni" name="dni"><br>'+ 		'<label for="fechaNacimiento">Fecha de nacimiento</label><input type="date" id="fecNacimiento" name="fecNacimiento"><br>'+ 		'<label for="localidad">Localidad de residencia</label><input type="text" id="localidad" name="localidad"><br>'+ 		'<label for="password">Contrasena</label><input type="password" id="password" name="password"><br>'+ 		'<input type="submit" id="enviar" name="enviar" value="enviar">'+ 		'<input type="reset" id="limpiar" value="limpiar">'+ 		'</form>'+ 		'</div>';	 	 		     document.getElementById("nombre").addEventListener('blur', campo20);     document.getElementById("apellido1").addEventListener('blur', campo20);    	 }	  function campo20(event) {     if ( >= 1 && <= 20) { = "green";         return true;     } else { = "red";         return false;     } }   function alta(event){ event.preventDefault();  if (campo20(event) === true ) {     alert("Datos validados y enviados");         let nombre = document.getElementById("nombre").value;         let apellido1 = document.getElementById("apellido1").value;         let apellido2 = document.getElementById("apellido2").value;         let dni = document.getElementById("dni").value;         let fecNacimiento = document.getElementById("fecNacimiento").value;         let localidad = document.getElementById("localidad").value;         let password = document.getElementById("password").value;         let numero = (100+arraySocios.length);         let socio = new Socio(nombre, apellido1, apellido2, dni, fecNacimiento, localidad,password,numero);          arraySocios.push(socio);          console.log(arraySocios.length);         console.log(socio.nombre);     	alert(socio.nombre);         for(var unSocio in arraySocios){             alert("Socio: "+arraySocios[unSocio].numero+" Nombre: "+arraySocios[unSocio].nombre+" Apellido: "+arraySocios[unSocio].apellido1);             console.log[arraySocios[unSocio].info];         }     return true; } else {     alert("Datos incorrectos");     return false; }  } //modificarDatos function modificarDatos() { event.preventDefault(); alert('modificarDatos'); 	 } //dar baja usuario function baja(){ //busca socio por dni y procede a la baja event.preventDefault(); alert('baja'); }
<html> <head> </head> <body >         <header>             <nav id="navbar">               <ul>                 <li><a href="#">inicio</a></li>                 <li onClick="showas()"><a href="#" >utilidades</a></li>                 <li id="usuarios"><a href="#">usuarios</a></li>                 <li><a href="#">enlace3</a></li>                 <li><a href="#">enlace4</a></li>               </ul>             </nav>         </header>          <div class="todo">             <aside id="asleft"></aside>                                    <section id="cuerpo"> </section>                           <aside id="asright"></aside>         </div>         </body>  </html>