501stLegionA3 / FiveOhFirstDataCore

A Web App designed to manage the 501st Legion StarSim Roster.
https://dc.501stlegion-a3.com/
MIT License
8 stars 12 forks source link

Modify Scoped User System #401

Closed Soyvolon closed 2 years ago

Soyvolon commented 2 years ago

Details

Update the scoped user system to be attached per page instead of a tree like structure. User scopes are baked into the page settings, and each element that can use a scope will access that information from a reference to a scope object.

The scope object will need to be initialized and/or otherwise updated depending on how it is used. For a local user scope, it still needs to be explicitly defined in the page. For form scopes, the for that modifies the scope needs to be attached to the scope itself. Multiple forms could be attached to the scope and all forms should update if a single one updates.

Draft UserScope object

public class UserScope : DataObject<Guid>
{
    public bool LocalUser { get; set; }
    public CustomPageSettings PageSetting { get; set; }
    public Guid PageSettingsId { get; set; }
    public string ScopeName { get; set; }
    public List<CustomComponentBase> AttachedListeners { get; set; }
    public List<CustomComponentBase> AttachedAssigners { get; set; }
}

Where listeners would listen to user updates and assigners would update the selected user for that scope.

Soyvolon commented 2 years ago

Rough implementation for this is done. Check the UserScope object.