Verb Mask Permissions Values - Bitwise


#1

Hi guys,

While looking for the verb role permissions in db, just to know how DF deal with those guys, but could not find any column with “POST, GET, PUT, DELETE or PATCH” value, I find out that every time I change the verb permission, the column “verb_mask” also have changed.
I was wondering wtf is that verb_mask in db, that control rules api permissions and sometimes that field is 3, then change to 5 or 8 or 31. Whata hell!?!?

Discovered a Bitwise operator and I got these values to verb_mask column and respective permissions values:

GET = 1
POST = 2
PUT = 4
PATCH = 8
DELETE = 16

GET + POST = 3
GET + PUT = 5
GET + PATCH = 9
GET + DELETE = 17

GET + POST + PUT = 7
GET + POST + PATCH = 11
GET + POST + DELETE = 19

GET + POST + PUT e PATCH = 15
GET + POST + PUT e DELETE = 23

POST + PUT = 6
POST + PATCH = 10
POST + DELETE = 18
POST + PUT e PATCH = 14
POST + PUT e DELETE = 22
POST + PUT e PATCH e DELETE = 30

PUT + PATCH = 12
PUT + DELETE = 20
PUT + PATCH e DELETE = 28

PATCH + DELETE = 24

ALL = 31

Sorry if this is not a question but thought this interesting.

[EDIT]

Same for Requestor:

API = 1
SCRIPT = 2
API + SCRIPT = 3

[EDIT 2]
Database Version: 1.9.0
DreamFactory Services Platform Version: 1.9.4
Admin Application Version: 1.0.12