parsav  Diff

Differences From Artifact [71684bc451]:

To Artifact [3a79c99b1d]:


    28     28   		'cred', 'elevate', 'demote', 'rebrand', -- modify site's brand identity
    29     29   		'herald' -- grant serverwide epithets
    30     30   	};
    31     31   	prepmode = lib.enum {
    32     32   		'full','conf','admin'
    33     33   	}
    34     34   }
           35  +
           36  +m.privmap = {}
           37  +do local struct pt { name:lib.mem.ptr(int8), priv:m.powerset }
           38  +for k,v in pairs(m.powerset.members) do
           39  +	m.privmap[#m.privmap + 1] = quote
           40  +		var ps: m.powerset ps:clear()
           41  +		(ps.[v] << true)
           42  +	in pt {name = lib.str.plit(v), priv = ps} end
           43  +end end
    35     44   
    36     45   terra m.powerset:affect_users()
    37     46   	return self.purge() or self.censor() or self.suspend() or
    38     47   	       self.elevate() or self.demote() or self.cred()
    39     48   end
    40     49   
    41     50   local str = rawstring
................................................................................
   204    213   	conprep: {&m.source, m.prepmode.t} -> {} -- prepares queries and similar tasks that require the schema to already be in place
   205    214   	obliterate_everything: &m.source -> bool -- wipes everything parsav-related out of the database
   206    215   
   207    216   	conf_get: {&m.source, rawstring} -> lib.mem.ptr(int8)
   208    217   	conf_set: {&m.source, rawstring, rawstring} -> {}
   209    218   	conf_reset: {&m.source, rawstring} -> {}
   210    219   
   211         -	actor_save: {&m.source, &m.actor} -> bool
   212    220   	actor_create: {&m.source, &m.actor} -> uint64
          221  +	actor_save_privs: {&m.source, &m.actor} -> {}
   213    222   	actor_fetch_xid: {&m.source, lib.mem.ptr(int8)} -> lib.mem.ptr(m.actor)
   214    223   	actor_fetch_uid: {&m.source, uint64} -> lib.mem.ptr(m.actor)
   215    224   	actor_notif_fetch_uid: {&m.source, uint64} -> lib.mem.ptr(m.notif)
   216    225   	actor_enum: {&m.source} -> lib.mem.ptr(&m.actor)
   217    226   	actor_enum_local: {&m.source} -> lib.mem.ptr(&m.actor)
   218    227   	actor_stats: {&m.source, uint64} -> m.actor_stats
   219    228