Non Simple Cards with Codenames

Idea

+tag

 

I was pondering this issue around a code comment from Ethan

Codenames can be assigned to !simple? cards. We can create the situation with rename, and if we don't want to prevent that, and I can't see that we would, we have to allow it.  This idea started in a reply to that comment.

 

 

Codename needs to be a Set, and I think it should. It is an easy change, and I think expressively powerful. Then we don't actually need indestructability of codenames as a feature. Just prevent it with a rule. Also, I think we need a permission rule setting that says 'not even admin' WagnBot may still be an exception. (special, like root). Note that 'read-only' can be just setting some rules:all+(create|delete|update|comment) -> :no_permission

 

The codename rules mean we can't let them delete these cards, but they can be hidden with rules. We'll go over this, but the upshot is that:

:invite would point to *invite+*thanks, or maybe it is :invite_thanks. That would make it indestructable without any code changes.

Also, as another example we can bind:

:default_type to the card *all+*default, then Card[:default_type].type_id is what Card::DefaultTypeID currently defines.

 

I'm in favor of this idea.  A couple of comments:

  1. The *all+*default part is very important.  Current functionality is actually broken, because changing its value (changing the type of *all+*default) won't change the constant (Card::DefaultTypeID).  It's another constant that shouldn't be a constant.
  2. One rule should be: if it's absence breaks things, it should have a codename.
  3. The invite stuff doesn't follow that rule.  I actually don't want codenames for those.  It should be fine for those plus cards not to exist.  Especially since that functionality is going to change soon so that this stuff uses flexmail.  Giving it a codename means migrating stuff in and then migrating it away again soon.  It's not that much code just to do the lookups (and it doesn't happen often enough to be a performance concern).
  4. Re no permission, we have "nobody" permission for comments.  We may be able to use something like that.

How does 'nobody' work?

 

Isn't that sort of a hack in the code now? A more formal mechanism may be better, no?

  --Gerry Gleason.....2012-12-10 17:46:59 +0000


hmm, I guess it's actually just an empty permissions rule. So, in fact, we may already support this, to some extent. The only difference is we don't really have a way to support Wagn Bot - only. always_ok? refers to Wagn Bot + accounts with administrator role. I suppose we could just make an is_bot? method...

  --Ethan McCutchen.....2012-12-10 18:14:04 +0000

+relevant user stories