void VJSSession::_promoteWith(VJSParms_callStaticFunction& ioParms, CUAGSession* inSession) { sLONG promotionToken = 0; CUAGGroup* group = RetainParamGroup(inSession->GetDirectory(), ioParms, 1); if (group != nil) { promotionToken = inSession->PromoteIntoGroup(group); } QuickReleaseRefCountable(group); ioParms.ReturnNumber(promotionToken); }
void VJSSession::_belongsTo(VJSParms_callStaticFunction& ioParms, CUAGSession* inSession) { bool ok = false; CUAGGroup* group = RetainParamGroup(inSession->GetDirectory(), ioParms, 1); if (group != nil) { ok = inSession->BelongsTo(group); } QuickReleaseRefCountable(group); ioParms.ReturnBool(ok); }
void VJSSession::_promoteWith(VJSParms_callStaticFunction& ioParms, CUAGSession* inSession) { sLONG promotionToken = 0; CUAGGroup* group = RetainParamGroup(inSession->GetDirectory(), ioParms, 1); if (group != nil) { CUAGThreadPrivilege* privileges = static_cast<CUAGThreadPrivilege*>(ioParms.GetContext().GetGlobalObjectPrivateInstance()->GetSpecific('uagX')); promotionToken = inSession->PromoteIntoGroup(group, privileges); } QuickReleaseRefCountable(group); ioParms.ReturnNumber(promotionToken); }
void VJSSession::_belongsTo(VJSParms_callStaticFunction& ioParms, CUAGSession* inSession) { bool ok = false; CUAGGroup* group = RetainParamGroup(inSession->GetDirectory(), ioParms, 1); if (group != nil) { CUAGThreadPrivilege* privileges = static_cast<CUAGThreadPrivilege*>(ioParms.GetContext().GetGlobalObjectPrivateInstance()->GetSpecific('uagX')); ok = inSession->BelongsTo(group, privileges); } QuickReleaseRefCountable(group); ioParms.ReturnBool(ok); }
void VJSSession::_checkPermission(VJSParms_callStaticFunction& ioParms, CUAGSession* inSession) { bool ok = false; CUAGGroup* group = RetainParamGroup(inSession->GetDirectory(), ioParms, 1); if (group != nil) { ok = inSession->BelongsTo(group); } if (!ok) { VString groupName; if (group != nil) group->GetName(groupName); ThrowError(VE_UAG_SESSION_FAILED_PERMISSION, groupName); } QuickReleaseRefCountable(group); ioParms.ReturnBool(ok); }
void VJSSession::_checkPermission(VJSParms_callStaticFunction& ioParms, CUAGSession* inSession) { bool ok = false; CUAGGroup* group = RetainParamGroup(inSession->GetDirectory(), ioParms, 1); if (group != nil) { CUAGThreadPrivilege* privileges = static_cast<CUAGThreadPrivilege*>(ioParms.GetContext().GetGlobalObjectPrivateInstance()->GetSpecific('uagX')); ok = inSession->BelongsTo(group, privileges); } if (!ok) { VString groupName; if (group != nil) group->GetName(groupName); ThrowError(VE_UAG_SESSION_FAILED_PERMISSION, groupName); } QuickReleaseRefCountable(group); ioParms.ReturnBool(ok); }