7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainen /* mask[] size as bytes */
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainen /* variable length bitmask */
93076575071edeb3fe0666588f0222fc300ec2c4Timo Sirainen (MALLOC_ADD((bitmask_size), sizeof(pool_t) + sizeof(unsigned int)))
08a0b7b0d0444875001847ef2b1b7b76122620abTimo Sirainenstruct acl_cache *acl_cache_init(struct acl_backend *backend,
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainenvoid acl_cache_deinit(struct acl_cache **cache);
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainenstruct acl_mask *acl_cache_mask_init(struct acl_cache *cache, pool_t pool,
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainen const char *const *rights);
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainenvoid acl_cache_mask_deinit(struct acl_mask **mask);
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainenunsigned int acl_cache_right_lookup(struct acl_cache *cache,
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainen const char *right);
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainen/* Flush cache for given object name */
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainenvoid acl_cache_flush(struct acl_cache *cache, const char *objname);
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainen/* Flush cache for all objects */
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainenvoid acl_cache_flush_all(struct acl_cache *cache);
0d7b2e0750386fe1646a17d83a803d1d5eb3d3a0Timo Sirainen/* Update object ACLs. The new rights are always applied on top of the
0d7b2e0750386fe1646a17d83a803d1d5eb3d3a0Timo Sirainen existing rights. The ordering by acl_id_type must be done by the caller. */
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainenvoid acl_cache_update(struct acl_cache *cache, const char *objname,
e50c1eb31159d8ccc116d8fb487a5e231d2033a1Timo Sirainen/* Return ACL object validity, or NULL if object doesn't exit. */
e50c1eb31159d8ccc116d8fb487a5e231d2033a1Timo Sirainenvoid *acl_cache_get_validity(struct acl_cache *cache, const char *objname);
e50c1eb31159d8ccc116d8fb487a5e231d2033a1Timo Sirainen/* Update ACL object validity, creating the object if needed. */
08a0b7b0d0444875001847ef2b1b7b76122620abTimo Sirainenvoid acl_cache_set_validity(struct acl_cache *cache, const char *objname,
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainen/* Returns all the right names currently created. The returned pointer may
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainen change after calling acl_cache_update(). */
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainenconst char *const *acl_cache_get_names(struct acl_cache *cache,
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainen unsigned int *count_r);
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainen/* Returns user's current rights, or NULL if no rights have been specified
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainen for this object. */
7fb70daba4e571eab5b64f496d20b9e37e31141bTimo Sirainenacl_cache_get_my_rights(struct acl_cache *cache, const char *objname);
2f122b4db3f0d4eeb59ff9d306e54b2009d72cf9Timo Sirainen/* Returns TRUE if given right index is set in mask. */
2f122b4db3f0d4eeb59ff9d306e54b2009d72cf9Timo Sirainenbool acl_cache_mask_isset(const struct acl_mask *mask, unsigned int right_idx);