RedisMembershipStore
The MembershipStore on Redis.
Implements
Section titled “Implements”MembershipStore
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RedisMembershipStore(
redis,options?):RedisMembershipStore
Parameters
Section titled “Parameters”Redis
options?
Section titled “options?”Pick<RedisStoreOptions, "prefix"> = {}
Returns
Section titled “Returns”RedisMembershipStore
Methods
Section titled “Methods”addMember()
Section titled “addMember()”addMember(
member):Promise<boolean>
Adds the member. False (and nothing written) when the user is already a member of the scope.
Parameters
Section titled “Parameters”member
Section titled “member”StoredMember
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”MembershipStore.addMember
changeRole()
Section titled “changeRole()”changeRole(
input):Promise<MemberWrite>
One atomic step: sets the role to to only if the member still holds
from, and, when from is in adminRoles and to is not, only if
another member of the scope holds a role in adminRoles. Of two
concurrent demotions of the last two admins, at most one is done.
Parameters
Section titled “Parameters”adminRoles
Section titled “adminRoles”readonly string[]
string
string
string
userId
Section titled “userId”string
Returns
Section titled “Returns”Promise<MemberWrite>
Implementation of
Section titled “Implementation of”MembershipStore.changeRole
findMember()
Section titled “findMember()”findMember(
scope,userId):Promise<StoredMember|null>
Parameters
Section titled “Parameters”string
userId
Section titled “userId”string
Returns
Section titled “Returns”Promise<StoredMember | null>
Implementation of
Section titled “Implementation of”MembershipStore.findMember
listMembers()
Section titled “listMembers()”listMembers(
scope):Promise<StoredMember[]>
Every member of the scope, in no particular order.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<StoredMember[]>
Implementation of
Section titled “Implementation of”MembershipStore.listMembers
removeMember()
Section titled “removeMember()”removeMember(
input):Promise<MemberWrite>
One atomic step: removes the member only if it still holds from, and,
when from is in adminRoles, only if another member of the scope holds
a role in adminRoles.
Parameters
Section titled “Parameters”adminRoles
Section titled “adminRoles”readonly string[]
string
string
userId
Section titled “userId”string
Returns
Section titled “Returns”Promise<MemberWrite>
Implementation of
Section titled “Implementation of”MembershipStore.removeMember