Esempio n. 1
0
Acl SecurityDescriptor::get_Dacl() {
	BOOL bDaclPresent, bDaclDefaulted;
	ACL *pacl;
	Win32Check(::GetSecurityDescriptorDacl(_self, &bDaclPresent, &pacl, &bDaclDefaulted));
	if (!bDaclPresent)
		Throw(E_FAIL);
	return Acl(pacl);
}
Esempio n. 2
0
std::string Acl::getDescription(std::string rights)
{
	std::string descr;
	size_t i;

	for (i=0; i<rights.size(); i++)
	{
		if (descr.size() > 0)
			descr += ", ";
		descr += Acl(rights.substr(i, 1)).getDescription();
	}
	return descr;
}
Esempio n. 3
0
void Acl::RightsScreen::init()
{
	size_t i;
	char c[2];

	std::string s=Gettext::fromutf8(identifier);

	titleBar->setTitles(s,_("PERMISSIONS"));

	Curses::CursesAttr attr;

	attr.setFgColor(color_perms_rights.fcolor);

	for (i=0; (c[0]=ACL_BITS[i]) != 0; i++)
	{
		c[1]=0;
		CursesButton *b=new CursesButton(this,
						 Acl(c).getDescription(),
						 origRights.find(c[0])
						 != std::string::npos ? -1:1);
		if (!b)
			throw strerror(errno);

		try {
			buttons.push_back(b);
		} catch (...) {
			delete b;
			throw;
		}

		b->setRow(i+2);
		b->setCol(2);
		b->setAttribute(attr);
	}

	saveButton.setRow(i+4);
	saveButton.setCol(4);
	buttons[0]->requestFocus();
}