Lupusregina Beta
Solution for lots of flags
Ahh. What would I use if not the hashset for the static data then? The tolower trim was to normalize the input, but that's gone now as I switched to using an enum for the permission nodes rather than typing them as strings. Roles are variable, users can add them.
Thanks!
20 replies
How do you kill off left padding/margin in DataGridView headers?
Of course, now that I think about it, this was a few years ago and since then I've bought a new rig; Core i7-13700K 3.4ghz, 128GB DDR4-3200, Samsung 990 Pro M.2 SSD so maybe I should try again. I can't imagine how VS could lag that, lol
20 replies
How do you kill off left padding/margin in DataGridView headers?
I installed 20... 22? i think it was at one point and it seemed really laggy. Like intellisense would take a couple seconds to update, it was frustrating. 2017 is lightning fast, so I just went back to it. Some day I'll hit a wall where I need newer than .NET 4.8 and that will force me to upgrade, but haven't hit it yet hehe.
20 replies
Solution for lots of flags
GetInheritanceSet returns a HashSet with all the nodes that would grant the key node, like
So if I do Has("Game.View") and the user doesn't explicitly have that but they do have Game.Launch, it would return true. Does that look workable?
20 replies
Solution for lots of flags
I have a followup question. I'm working on implementing this. I have a static Perm class now, with a private Dictionary<Guid, HashSet<string>> Permissions. I have an Init method that populates the dict with the user's ID's then all the nodes to which they have permission. Then I have:
But I'd like to support inheritance. Like If I have nodes like:
If I'm checking for Game.View, then if they have edit, delete or launch it stands to reason that view is a given. What would be a good way to handle that?
20 replies
Solution for lots of flags
So like when I do a permission check, just have a method that does like
SELECT index FROM permissions WHERE uid = ?uid AND permcode = ?perm
Then pass the user Guid and maybe a string like "game.delete" then if a row is returned, I know they're authorized else deny?
20 replies
How do you kill off left padding/margin in DataGridView headers?
Yea, I'm afraid I'm old school hehe. Using VS2017 and WinForms. I know, I know.. I need to get with it already and learn WPF I just haven't gotten around to it.
Thanks though!
20 replies
Control getting resized when adding to FlowLayoutPanel
The behavior I was expecting was just for it to add my UserControl with the data populated, and not adjust the UC's width. I wasn't sure why the width would get fiddled with.
As to why a FLP, I need to add a variable amount of controls to the form and have it scrollable. I wasn't sure there was a better way than a FLP?
4 replies