Can't we use this:

```python
def singlemask(perm):
    RIGHTS = ['delete', 'update', 'read', 'create']
    perms = [p for p in perm if perm.get(p)]
    byte = 0
    for p in perms:
        byte += 2**RIGHTS.index(p)
    return byte
```