Object-Permission (navigate, show, etc.) don't work with MSSQL


The basic object permissions like navigate, show, add, etc. don't work when using a MSSQL Server as database.

var permsFromDb = _getContextPermDao().selectData(
selectFields = [ "Max( granted ) as granted", "context_key" ]
, filter = { context = args.context, permission_key = args.permissionKey, security_group = userGroups }
, groupBy = "context_key"
, useCache = false);

The field granted is of type boolean in the db.
While Max( granted ) is valid in mysql (what I think is wrong, because a max of a boolean makes no sense) this statement fails in MSSQL. The reason is simple: can't do a max on a boolean.

The quick and dirty workaround here is max(cast(granted as int)).

The problem is, that there must be found a query that works for all DBs.


MSSQL Server


Michael Hnat
March 23, 2017, 12:45 PM

This kind of error shows up a problem to me.
While the mssql adapter works mostly fine, sometimes something wierd is happening.
In this case I really get an error message, but in other cases just the result is not what I expected.
Why does this problem don't show up in the testuite? Is there no test for the MSSQL adapter?

I know that MSSQL is not really officially is supported, and there are open source solutions out there, etc. But if you're working with really big databases (>10GB) and need support, you can't run just mysql. You either nedd mysql enterprise, oracle or MSSQL. And after the latest pricelist of MS, MSSQL is again a solid solution without any hassles. If you ever tried running Mysql in a galera cluster you know what I mean.

I actually have no solid solution how to get on with DB problems like this. But I think beside MySQL other db system should full work with Preside.




Michael Hnat