8 – Add extra custom permissions to Field Permissions

I’m using Field Permissions module to restrict access to each field.

If you choose custom permission on /admin/structure/types/manage/CONTENT_TYPE/fields/FIELD_NAME, you’ll see these permissions are available:

  • Enter own value for field [FIELD_NAME]
  • Edit own value for field [FIELD_NAME]
  • Edit any value for field [FIELD_NAME]
  • View own value for field [FIELD_NAME]
  • View any value for field [FIELD_NAME]

I would like to add some permissions with extra conditions like ‘Edit any value for field [FIELD_NAME] if the field is empty’.

For D7 version of the module there was a hook called hook_field_permissions_list_alter but there’s no such thing in D8 version.

Is there any way to modify the list?

c# – How to ignore specific field on SaveChanges in Entity Framework Core?

Say, I have a model Car with these properties (for simplicity, I skipped get/set):

string Name;    // user can change
string Secret;  // user cannot change
DateTime CreatedAt = DateTime.Now;  // even we cannot change

Then in ASP Web Application 3.1, the scaffold generates Edit.cshtml.cs with this contents (simplified):

(BindProperty)
public Car Car { get; set; }
public Task<IActionResult> OnPost()
{
    _context.Attach(LanguageExporter).State = EntityState.Modified;
    _context.SaveChanges();
    // redirect ...
}

So it allows a user to make POST with all the fields of Car.

But actually, I would like to ignore CreatedAt completely and not allow changing Secret from POST parameters (but allow from code).
(BindNever) does not help since ASP skips Secret and it keeps default(string) => null on it which I don’t want. For CreatedAt it keeps default(DateTime) => 01.01.0001.


So I am appealing to the community with the question, how can I automate the process of editing my models?

As I see it, ASP should ignore some POST parameters and EF should ignore updating some properties. Or ASP should fetch the model first and change only particular properties (e.g. keep CreatedAt).

What are the best practices out there in this situation?

Bitcoin Version Message Addrme/addryou Time Field missing + wrong protocol version

i was doing some research on the Bitcoin addrme / addryou I came across a coin which wanted 8 byte more as a Message. After quite some time looking at 3 wallets ZeroCoin/Raven/Bitcoin i got some results but i cannot understand the issue.

  1. I looked at the Bitcoin Documentation at https://en.bitcoin.it/wiki/Protocol_documentation#Network_address they mentioned there for the time field follwoing:
    4 time uint32 the Time (version >= 31402). Not present in version message.
    With the not present i was a little confused it is as desribed not present but if you lock at the logic you would think it should be present it compares the protocol Version to be greater than 31402.

Here is the ZeroCoin Wallet where i first saw the issue:

AE 5F 01 00 0D 00 00 00 00 00 00 00 B2 42 04 5F
00 00 00 00 00 E1 F5 05 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 FF FF 61 57 43 87
DC 76 00 E1 F5 05 0D 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
22 48 CA CC 0C 98 49 22 12 2F 53 61 74 6F 73 68
69 3A 30 2E 31 34 2E 30 2E 31 2F 9E 4F 04 00 01

See Here Decoding:
enter image description here

As you can see i needed to add the Timestamp into the message to make of for the 8 byte total longer message

Here is Ravencoin:

8C 11 01 00 0D 00 00 00 00 00 00 00 28 BA 03 5F
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 FF FF 61 57 43 87 ED A6 0D 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 0A 3D C3 23 3F B8 4D 38
25 2F 52 61 76 65 6E 63 6F 69 6E 3A 34 2E 32 2E
30 28 73 65 65 64 2E 72 61 76 65 6E 63 6F 69 6E
2E 6F 72 67 29 2F C9 F4 13 00 01

Ignore the fact that the strmessage is different it just cosmetic.
enter image description here

Here is Bitcoin

7F 11 01 00 09 04 00 00 00 00 00 00 27 44 04 5F
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 FF FF 61 57 43 87 DC A9 09 04
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 62 22 8D A8 33 26 00 47
10 2F 53 61 74 6F 73 68 69 3A 30 2E 32 30 2E 30
2F AC BC 09 00 01

Decodes to
enter image description here

So knowing all that information i added debug Code in 3 wallets:
into the Protocol.h (keep in mind that the syntax on raven and zerocoin is slightly different but the prints where at the same spots)

   SERIALIZE_METHODS(CAddress, obj)
    {
        SER_READ(obj, obj.nTime = TIME_INIT);
        int nVersion = s.GetVersion();
        if (s.GetType() & SER_DISK) {
            printf("nVersion %dn", nVersion);
            READWRITE(nVersion);
        } else {
            printf("Not evaluated nVersion %d Type %dn", nVersion, s.GetType());
        }
        if ((s.GetType() & SER_DISK) ||
            (nVersion >= CADDR_TIME_VERSION && !(s.GetType() & SER_GETHASH))) {
            READWRITE(obj.nTime);
            printf("nTime %dn", obj.nTime);
        } else {
            printf("Not evaluated nTime %dn", obj.nTime);
        }
        READWRITE(Using<CustomUintFormatter<8>>(obj.nServices));
        printf("nServicesInt %dn", obj.nServices);
        READWRITEAS(CService, obj);
    }

Ravencoins Output:

Receive addrMe
Not evaluated nVersion 209 Type 1
Not evaluated nTime 100000000
nServicesInt 0
Receive addrFrom
Not evaluated nVersion 209 Type 1
Not evaluated nTime 100000000
nServicesInt 13
IP:2020-07-07 09:55:24 receive version message: /Ravencoin:4.2.0(seed.ravencoin.org)/: version 70028, blocks=1308436, us=97.87.67.135:56651, peer=0

It skips Version and Time Reading

BTC’s

Receive addrMe
Not evaluated nVersion 209 Type 1
Not evaluated nTime 100000000
nServicesInt 0
Receive addrFrom
Not evaluated nVersion 209 Type 1
Not evaluated nTime 100000000
nServicesInt 1033
2020-07-07T01:35:08Z New outbound peer connected: version: 70015, blocks=638069, peer=1 (full-relay)

Same thing skip nVersion and nTime

ZeroCoin

Receive addrMe
Not evaluated nVersion 90013 Type 1
nTime 100000000
nServicesInt 0
Receive addrFrom
Not evaluated nVersion 90013 Type 1
nTime 100000000
nServicesInt 13
2020-07-07 10:01:38 receive version message: /Satoshi:0.14.0.2/: version 90030, blocks=282531, us=97.87.67.135:56726, peer=0

This one skips the nVersion cause the type doe not match however it reads the ntime cause it actual holds its protocol Version 90030.

Here are my Questions:

  1. Why does Bitcoin and ravencoin evaluates 219 as nVersion and not their protocol Version as seen with Zerocoin?
  2. Where is nVersion written the 219 i guess its part of the serialisation (i am not a c++ guy)
  3. Is that behaviour wanted that nTime is missing or is this a bug related to not checking against the corrent Protocol Number?

Thank you for your help
Sascha

magento2.3 – What is the field sales_order_item.description field used for?

Can anyone provide any information on what the “description” field in the sales_order_item table is used for? I never see it populated with any data, and it’s not listed in the docs that I can find.
https://docs.magento.com/mbi/data-analyst/data-warehouse-mgr/sales-flat-order-item-table.html

I need to add a field to store notes on individual order items, then I noticed this apparently un-used field. Can anyone tell me what is supposed to be stored here?

8 – Date field adds a hidden apostrophe

I use Excel Serialization to export views data on Excel. The exported file (xls or xlsx it doesn’t matter) adds a hidden apostrophe in the beginning of every date cell (’08/07/2011) which can be seen only on the input line. This leads to wrong column sorting. The cell format is Number instead of Date and this probably causes the problem.

There is a workaround to remove the apostrophes from the whole column, but I want to have the cells without it from the beginning. Is there any way to do this? Maybe by formatting the column before the export? No support from the module maintainers. Any ideas?

Thanks.

Which field is more interesting in digital marketing: SEO or SMM..? – SEO Help (General Chat)

Hi Friends,
First of all you need to understand the different between SEO and SMM.

The technique of SEO is to improve the search engine rankings of a website, give it more visibility and hence, more traffic. The technique involves optimizing the website, adding keywords in the Title, Meta tags, content and Meta description, frequently updating a website and increasing the speed at which it loads on a desktop and mobile device. This means that if your website is optimized according to the SEO techniques, the chances that your website will appear on the first and second position in SERP for search queries.

SMM is promotion through social media channels. It gives you a chance to tap into a huge social media community available on several channels. It tends to also include ‘Paid Social Search’ or paid advertising on social media. Although paid social search is similar to SEM, it adds behavioral tendency into the search equation. The major part of the advertising is, however, the same as SEM, where an advertiser only pays when a user clicks on his or her advertisement.

Every-field is interesting in digital marketing depends, which channel is good for your ‘product’ promotion. Now that you know what the terms SEO and SMM mean also look for SEM and SMO before proceeding.