You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.
One of the bigger features I'd like to develop over time for this library is the ability to automatically grant and revoke perks. The way that this would work is that the library would offer a common interface for granting and revoking perks as well as an integration with either GitHub Webhooks or the Laravel Scheduler to check periodically for updates and then handle revoking or granting perks.
The actual implementations of whatever perk would be a custom implementation for the consumer of the library. This would open the door for an entire ecosystem of perks like a collection of integrations with different services and what not.
A practical example could be to grant access to a Discord server when you're sponsoring someone:
finalclass DiscordServerPerk implements Perk
{
publicfunctiongrant(): bool
{
// handle the logic to grant access to the server...
}
publicfunctionrevoke(): bool
{
// handle the logic to revoke access to the server...
}
publicfunctiontiers(): array
{
// return the tiers that allow access to this perk...
}
}
By returning the tiers that allow access to the perk the library should be able to automatically grant or revoke the perk depending when a user is changing tiers. If they're changing to a new tier that's also in the tiers list of the perk, nothing would change of course.
This idea is a little rough and there's probably tons of edge cases but it would be worth to explore a PoC for this.
The text was updated successfully, but these errors were encountered:
One of the bigger features I'd like to develop over time for this library is the ability to automatically grant and revoke perks. The way that this would work is that the library would offer a common interface for granting and revoking perks as well as an integration with either GitHub Webhooks or the Laravel Scheduler to check periodically for updates and then handle revoking or granting perks.
The actual implementations of whatever perk would be a custom implementation for the consumer of the library. This would open the door for an entire ecosystem of perks like a collection of integrations with different services and what not.
The interface would look as follows:
A practical example could be to grant access to a Discord server when you're sponsoring someone:
By returning the tiers that allow access to the perk the library should be able to automatically grant or revoke the perk depending when a user is changing tiers. If they're changing to a new tier that's also in the tiers list of the perk, nothing would change of course.
This idea is a little rough and there's probably tons of edge cases but it would be worth to explore a PoC for this.
The text was updated successfully, but these errors were encountered: