- summary: Dummy node check unnessesary --> Dummy node check unnessesary in hasTypeAccess
The way that
Everything::Node::nodetype::hasTypeAccess works now
is that it creates a dummy nodetype to check
permissions against. This leads to a lot of checking into
the database for no reason whatsoever.
SELECT node_id FROM nodegroup WHERE
nodegroup_id=-1 ORDER BY orderby
That doesn't really make any sense. There's about five in
a pageload if you search for a node and one isn't found.
(one for each type in the create a new node dialog)
The better way to fix this would be to predict the
permissions, instead of creating a node and seeing how
it went.
We already have the default access for the types and
can create something based off of of
Everything::Node::getDefaultPermissions() and
Everything::Security::checkPermissions()
That way you don't have to go to the database to force
create it.