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

Description

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.

Environment

MSSQL Server

Assignee

Unassigned

Reporter

Michael Hnat

Labels

None

Accepted

None

Priority

High
Configure