Spear.set_global_acl
You're seeing just the function
set_global_acl
, go back to Spear module for more information.
Link to this function
set_global_acl(conn, user_acl, system_acl, opts \\ [])
View Source (since 0.1.3)Specs
set_global_acl( connection :: Spear.Connection.t(), user_acl :: Spear.Acl.t(), system_acl :: Spear.Acl.t(), opts :: Keyword.t() ) :: :ok | {:error, any()}
Sets the global stream ACL
This function appends an event to the $streams
EventStoreDB stream
detailing how the EventStoreDB should allow access to user and system
streams (with the user_acl
and system_acl
arguments, respectively).
See the security guide for more information.
Options
:json_encode!
- (default:Jason.encode!/1
) a 1-arity JSON encoding function used to serialize the event. This event must be JSON encoded in order for the EventStoreDB to consider it valid.
Remaining options are passed to Spear.append/4
. The :expect
option
will be applied to the $streams
system stream, so one could attempt to
set the initial ACL by passing expect: :empty
.
Examples
This recreates the default ACL:
iex> Spear.set_global_acl(conn, Spear.Acl.allow_all(), Spear.Acl.admins_only())
:ok