Hello! Welcome to my humble web presence. I'm Mark Hamstra, 29 years young, wearer of many hats at modmore, resident of Leeuwarden, the Netherlands. Most of my time is spent building and maintaining awesome extras and tools at modmore, but I also love gaming, cooking, and my dogs. More about me.

This site is where I share thoughts, cool projects and other oddities related to MODX, xPDO and ExtJS. I also write about MODX regularly over at MODX.today. Sometimes I post three blogs in a week, sometimes there's nothing new here in a year. Read a random article.

I'm pretty sure it was the wedding of two of my best friends at the end of July 2016 that finally tipped the scale. Seeing their love and commitment broke down the last wall I had built up, and made me decide to admit to what I had been hiding for years. In the following weeks I came out as bisexual to the people closest to me, including my parents and those best friends after they returned from their honeymoon.

While my first romantic thoughts for men probably date back to high school, those had been neatly tucked away behind layers of insecurity and telling myself "it's just a phase" and "everyone probably feels confused like this" until I believed it myself. Even though I live in one of the most accepting countries in the world when it comes to LGBT, it took me a long time to accept these feelings - and myself.

Being bisexual also didn't help. While it's fine if you have trouble choosing what you want for dinner because the entire menu looks amazing, or being unsure about how business decisions will pan out, for a long time I had more-or-less accepted that I was different from the norm but couldn't figure it out. At times I thought I was just so deep in the closet that I didn't want to accept I was just gay (and since coming out as bi, several people have suggested this to be the case too), but I knew the feelings I've had for women were just as true. That just confused me even more for a while.

Eventually I accepted that on a scale from 0 (straight) to 100 (gay), I'm about a 65 right now. Everyone's somewhere on that scale, and may be on different places throughout their life. I just happen to be more towards the middle than most people. (While writing this post, I learned about the Kinsey Scale which is the same idea, but uses a scale of 0 to 6; I'd put myself as a 4 on that scale).

So, to get back to why I started writing this post...

Since the summer of 2016 I've been telling people of my sexuality regularly, but I've not made a big deal about it or announced it to the world. Even within my family, many people probably don't know. Typically I tell people when they ask if I have a girlfriend yet, by saying something along the lines of that it could've been a boyfriend too.

I don't introduce myself as "Mark Hamstra, 27, bisexual", I've not posted unambiguously on Facebook or Twitter about my coming out, and you wont find me dancing half-naked on a boat during the Amsterdam Gay Pride anytime soon either (you're welcome). While my sexuality is part of who I am, it is not what primarily defines me, and I've been treating it like a detail not everyone has to be made instantly aware of.

From time to time that has made some things a little more complicated than strictly necessary. In situations where people who I have not told unintentionally touch on the topic (for example "are you seeing anyone?", "did you buy your house by yourself?"), there's sometimes an (unintentional) undertone that assumes I'm straight. This can come from people that I've known for ages who I trust enough that I want to correct their assumption. But as I have about a split second to decide to either come out to them (and whoever else may be part of/listening to the conversation), or to fall back to pretending to be straight like I've done for so long, I sometimes choose the latter and regret it a few hours later. It feels like I'm lying to those people, which is also holding me back. As if one leg is still stuck in the closet, and I need to break it down to really get out.

So, long story short, I'm bisexual, and now that it's public knowledge I can stop caring as much about who does and who doesn't know.

Today I found out about an initiative from Ben & Jerry's, the ice cream company, to promote marriage equality in Australia. They set up a marketing campaign where you're not allowed to buy two scoops of the same flavour until same-sex marriage is made legal.

It's a bit tongue-in-cheek, but they're also hitting some serious notes by encouraging people to contact their government representatives to request actual political action. Not everyone seems to be a big fan, but it got me thinking about what a business should (or should not) do with its platform or reach.

With my business, modmore, I've always tried to avoid political issues.

Of course I have personal opinions on Trump, LGBT rights, diversity in tech, religions, Brexit, and all sorts of other topics. I'd love to discuss those topics, on personal title, in the future.

But I've always tried to avoid forcing my own political/social thoughts onto modmore, so modmore as an entity wouldn't "pick a side" on certain topics.

Ideas that I might consider common sense (such as the same-sex marriage Ben & Jerry's is promoting), are literally illegal in some countries. And things that are considered common sense elsewhere might not match my worldview either.

Those differences are a given, and I've never seen it as a responsibility for modmore to take its platform and reach to encourage my view of the world, or how it should be, on customers.

People come to modmore for the excellent MODX extras and support, not a lecture about same-sex marriage.

Then, just a few weeks ago, we had a sale at modmore where people who spent over €50 received a free pack of Stroopwafels with their order. Stroopwafels are typical Dutch cookies, and part of that sale was to share a Dutch tradition, King's Day, with the world.

The sale promoted the Dutch heritage of modmore. It didn't judge countries that do not celebrate King's Day, nor did it lobby for Stroopwafels to be produced worldwide. But it did take something that is common sense in the Netherlands, and shared that with the world in a promotion.

Reflecting on it while writing this post, I may have diverged from my original stance with the sale. King's Day and stroopwafels are not really a controversial topic, but couldn't one say that promoting same sex marriage is also just promoting the Dutch heritage? After all, the Dutch were the first to legalise same-sex marriage in 2001. It's part of the Dutch history, and a great achievement for the LGBT community, definitely worthy of celebration.

So now I'm wondering, is there really a difference between shipping customers stroopwafels to celebrate King's Day, and rainbow-coloured hats on Gay Pride?

Perhaps it is my responsibility as business owner to do more to encourage equality, diversity, and other good things to make the world a slightly better place for everyone. That I can live freely in my country, irrespective of my sexuality or (lack of) beliefs, is a great privilege that deserves to be shared and promoted.

Saying and doing nothing is also a political statement, so maybe it's time for modmore to take a more active stance on certain topics that I care about.

What is your take on this? Should businesses use the reach they may have to influence politics or social opinions? Is that perhaps even their responsibility? Or should they just stick to their core business and leave politics out of it?

While working on adding a set of permissions to the ContentBlocks component, Isaac was wondering if there were any good ways of testing them out. The permission system in MODX is not very popular due to its (perceived?) complexity and the need to constantly flush permissions to see a result.

yeah, and the only reliable way i’ve found to test permissions in modx is to have one browser session with the admin changing permissions, and a separate session with the test user. and EVERY SINGLE TIME YOU CHANGE A PERMISSION, you log the test user out and back in ~ Isaac Niebeling

We had a bit of a conversation following that about how the ACLs work.

I had been using the Manage > Flush Your Permissions for refreshing permissions on my limited admin account. I simply made sure the limited user could access that, and that made my testing a lot easier than logging out and in again over and over.

That already seems like one step up, but can we do better?

It turns out that MODX has this thing called Stale Sessions. They've been introduced way back in 2.2.1 and their primary goal is to have a user refresh the "attributes" in its session (which contains a cache of many things about the user, including settings and permissions) the next time it requests a page.

I vaguely remembered that being there, but wasn't quite sure how it worked so I did a search across the MODX codebase to find instances of it, to see where it was called and how it affected the sessions. And that's when I stumbled across the processor for the Manage > Flush Your Permissions menu item.

As the name indicates, the Flush Your Permissions action will to flush the permissions of the user that is logged in. It even warns you that it doesn't affect other user sessions.

But that's a big lie.

The Flush Your Permissions processor isn't restricted to a single user. It tells all users to reload their permissions, through the Stale Sessions feature introduced in 2.2. Seriously, just check the source code if you don't believe me, there's no mention of the current user.

Following this discovery I did some testing with my new set of permissions for ContentBlocks, and indeed flushing the permissions for a full admin user also affected my limited admin user in a different browser.


The commit that introduced this behaviour back in 2012 mentions that it doesn't yet affect anonymous sessions, as those don't have a user record that instructs them to refresh their session, so that's a bit of a caveat if you're working with ACLs for site visitors. But when tweaking client access to the manager, using Flush Your Permissions instead of logging out and back in is going to save you a lot of time.

Can we do better?

So aside from this being a time saver, is there anything else we can do with this information?

Well, one of the reasons I started looking into this was to see if there might be a way to make MODX automatically flush relevant sessions when access policies are changed or added to a user group.

I had concerns about practicality because it could take a long time on large sites, but some tests of the flush permissions feature seem to indicate that it's only a few hundred milliseconds even on sites with thousands of users. That seems totally acceptable for the convenience of not having to flush permissions manually in a lot of cases.

It turns out, the core is already doing this, but only when creating a user group using the access wizard. Not when updating a user group, or when a policy is added, updated or removed.

Sounds like some pull requests may be in order.