MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / evlRoleInUse

Function evlRoleInUse

src/jrd/SysFunction.cpp:6836–6860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6834}
6835
6836dsc* evlRoleInUse(thread_db* tdbb, const SysFunction*, const NestValueArray& args,
6837 impure_value* impure)
6838{
6839 fb_assert(args.getCount() == 1);
6840
6841 Request* request = tdbb->getRequest();
6842 Jrd::Attachment* attachment = tdbb->getAttachment();
6843
6844 const dsc* value = EVL_expr(tdbb, request, args[0]);
6845 if (request->req_flags & req_null) // return NULL if value is NULL
6846 return NULL;
6847
6848 string roleStr(MOV_make_string2(tdbb, value, ttype_none));
6849
6850 // sorry - but this breaks role names containing lower case letters
6851 // roles to be entered as returned by CURRENT_ROLE
6852 //roleStr.upper();
6853
6854 impure->vlu_misc.vlu_uchar = (attachment->att_user &&
6855 attachment->att_user->roleInUse(tdbb, roleStr.c_str())) ? FB_TRUE : FB_FALSE;
6856
6857 impure->vlu_desc.makeBoolean(&impure->vlu_misc.vlu_uchar);
6858
6859 return &impure->vlu_desc;
6860}
6861
6862
6863dsc* evlSystemPrivilege(thread_db* tdbb, const SysFunction*, const NestValueArray& args,

Callers

nothing calls this directly

Calls 8

EVL_exprFunction · 0.85
MOV_make_string2Function · 0.85
roleInUseMethod · 0.80
makeBooleanMethod · 0.80
getCountMethod · 0.45
getRequestMethod · 0.45
getAttachmentMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected