MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / getFileSecurity

Function getFileSecurity

src/envsecurity.cpp:701–724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

699}
700
701FileSecurity getFileSecurity(const QString& path)
702{
703 FileSecurity fs;
704
705 try {
706 auto sd = getSecurityDescriptor(path);
707 auto dacl = getDacl(sd.get());
708 auto currentUser = getCurrentUser();
709 auto owner = getFileOwner(sd.get());
710 auto access = getEffectiveRights(dacl, currentUser.get());
711
712 fs.rights = makeFileRights(access);
713
714 if (EqualSid(owner, currentUser.get())) {
715 fs.owner = "(this user)";
716 } else {
717 fs.owner = getUsername(owner);
718 }
719 } catch (failed& f) {
720 fs.error = f.what();
721 }
722
723 return fs;
724}
725} // namespace env

Callers 1

makeDetailsFunction · 0.85

Calls 9

getSecurityDescriptorFunction · 0.85
getDaclFunction · 0.85
getCurrentUserFunction · 0.85
getFileOwnerFunction · 0.85
getEffectiveRightsFunction · 0.85
makeFileRightsFunction · 0.85
getUsernameFunction · 0.85
getMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected