Best design pattern to control permissions on a “per object per user” basis with ServiceStack?

I use per object permissions in my ServiceStack applications. Effectively this is an Access-Control-List (ACL). I have created a Working Self Hosted Console Example which you can fork on GitHub. ACL pattern: I use the database structure shown in the diagram below, whereby resources in my database such as documents, files, contacts etc (any resource … Read more

Checking file owner permissions

You can use stat to get the file permissions, and parse them with another command to get the character you want. stat -c %A someFile Returns something like: -rw-rw-r– EDIT: Here you go: stat -c %A someFile | sed ‘s/…\(.\).\+/\1/’ Returns either – or x if the owner has execute. EDIT 2: For completion’s sake: … Read more

Custom function throws a “You do not have the permission required to setValue” error

from the documentation : Custom functions return values, but they cannot set values outside the cells they are in. In most circumstances, a custom function in cell A1 cannot modify cell A5. However, if a custom function returns a double array, the results overflow the cell containing the function and fill the cells below and … Read more

Update to androidx.fragment:fragment:1.3.0-alpha08: registerForActivityResult not allowed after onCreate anymore. How to use after onCreate?

It just means that you shouldn’t register the callback after onCreate(). So you can do this private val checkPermission = registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { … } and then launch the check anytime you need it checkPermission.launch(array-of-permissions) The reason: When starting an activity for a result, it is possible (and, in cases of memory-intensive operations such as camera … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)