You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assertions on privilege, etc. repeat across db-level scripts. The repetition can be eliminated by adding assertion functions to addHelpers.sql and calling the assertion functions from all DB-level scripts except initializeDB.sql from PR #94
The text was updated successfully, but these errors were encountered:
I have in mind functions such as the following to be added to addHelpers.sql because there are a few instances of such code in various files. I assume the exception propagates from a function to the calling transaction.
The code below is an example of an assertion function. And, it is quite possible the code needs some tweaks. Still showing it here to share the idea.
At this point, I will put this issue on backlog. We can reconsider before M1's release if an opportunity presents to add assertions.
CREATE OR REPLACE FUNCTION
classdb.assertSuperUser(message VARCHAR DEFAULT NULL,
roleName VARCHAR(63) DEFAULT current_user
)
RETURNS BOOLEANAS
$$
BEGIN
IF NOT (SELECTclassdb.isSuperUser(roleName)) THEN
RAISE EXCEPTION
COALESCE(message, format('Role %s is not a superuser', roleName));
END IF;
END;
$$ LANGUAGE plpgsql;
Assertions on privilege, etc. repeat across db-level scripts. The repetition can be eliminated by adding assertion functions to
addHelpers.sql
and calling the assertion functions from all DB-level scripts exceptinitializeDB.sql
from PR #94The text was updated successfully, but these errors were encountered: