Apply the correct permissions based on asset type in the importer

Sat, 23 Apr 2016 14:29:41 +0200

author
Ansariel
date
Sat, 23 Apr 2016 14:29:41 +0200
changeset 48976
ed2bf4d076b6
parent 48975
6a6f63596e9b
child 48977
09948de7055a

Apply the correct permissions based on asset type in the importer

indra/newview/fsfloaterimport.cpp file | annotate | diff | revisions
     1.1 --- a/indra/newview/fsfloaterimport.cpp	Sat Apr 23 01:35:37 2016 +0200
     1.2 +++ b/indra/newview/fsfloaterimport.cpp	Sat Apr 23 14:29:41 2016 +0200
     1.3 @@ -1184,6 +1184,7 @@
     1.4  	LLInventoryType::EType inventory_type = LLInventoryType::defaultForAssetType(asset_type);
     1.5  	bool new_file_agent_inventory = false;
     1.6  	LLWearableType::EType wearable_type = NOT_WEARABLE;
     1.7 +	std::string perms_prefix = "";
     1.8  
     1.9  	if (name.empty())
    1.10  	{
    1.11 @@ -1194,6 +1195,7 @@
    1.12  	{
    1.13  	case LLAssetType::AT_TEXTURE:
    1.14  	{
    1.15 +		perms_prefix = "Uploads";
    1.16  		temporary = getChild<LLCheckBoxCtrl>("temp_asset")->get();
    1.17  		if (temporary)
    1.18  		{
    1.19 @@ -1209,6 +1211,7 @@
    1.20  		break;
    1.21  	case LLAssetType::AT_SOUND:
    1.22  	{
    1.23 +		perms_prefix = "Uploads";
    1.24  		temporary = getChild<LLCheckBoxCtrl>("temp_asset")->get();
    1.25  		if (temporary)
    1.26  		{
    1.27 @@ -1228,6 +1231,7 @@
    1.28  	case LLAssetType::AT_CLOTHING:
    1.29  	case LLAssetType::AT_BODYPART:
    1.30  	{
    1.31 +		perms_prefix = "Wearables";
    1.32  		std::string asset(asset_data.begin(), asset_data.end());
    1.33  
    1.34  		S32 position = asset.rfind("type");
    1.35 @@ -1271,6 +1275,7 @@
    1.36  		break;
    1.37  	case LLAssetType::AT_NOTECARD:
    1.38  	{
    1.39 +		perms_prefix = "Notecards";
    1.40  		if (inventory_item.isNull())
    1.41  		{
    1.42  			// create inventory item first
    1.43 @@ -1294,6 +1299,7 @@
    1.44  		break;
    1.45  	case LLAssetType::AT_LSL_TEXT:
    1.46  	{
    1.47 +		perms_prefix = "Scripts";
    1.48  		if (inventory_item.isNull())
    1.49  		{
    1.50  			// create inventory item first
    1.51 @@ -1325,6 +1331,7 @@
    1.52  		break;
    1.53  	case LLAssetType::AT_ANIMATION:
    1.54  	{
    1.55 +		perms_prefix = "Uploads";
    1.56  		temporary = getChild<LLCheckBoxCtrl>("temp_asset")->get();
    1.57  		if (temporary)
    1.58  		{
    1.59 @@ -1342,6 +1349,7 @@
    1.60  		break;
    1.61  	case LLAssetType::AT_GESTURE:
    1.62  	{
    1.63 +		perms_prefix = "Gestures";
    1.64  		if (inventory_item.isNull())
    1.65  		{
    1.66  			// create inventory item first
    1.67 @@ -1445,7 +1453,7 @@
    1.68  	data->mAssetInfo.mType = asset_type;
    1.69  	data->mAssetInfo.mCreatorID = gAgentID;
    1.70  	data->mInventoryType = inventory_type;
    1.71 -	data->mNextOwnerPerm = LLFloaterPerms::getNextOwnerPerms();
    1.72 +	data->mNextOwnerPerm = LLFloaterPerms::getNextOwnerPerms(perms_prefix);
    1.73  	data->mExpectedUploadCost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
    1.74  	FSResourceData* fs_data = new FSResourceData;
    1.75  	fs_data->uuid = asset_id;
    1.76 @@ -1468,9 +1476,9 @@
    1.77  			body["inventory_type"] = LLInventoryType::lookup(inventory_type);
    1.78  			body["name"] = name;
    1.79  			body["description"] = description;
    1.80 -			body["next_owner_mask"] = LLSD::Integer(LLFloaterPerms::getNextOwnerPerms());
    1.81 -			body["group_mask"] = LLSD::Integer(LLFloaterPerms::getGroupPerms());
    1.82 -			body["everyone_mask"] = LLSD::Integer(LLFloaterPerms::getEveryonePerms());
    1.83 +			body["next_owner_mask"] = LLSD::Integer(LLFloaterPerms::getNextOwnerPerms(perms_prefix));
    1.84 +			body["group_mask"] = LLSD::Integer(LLFloaterPerms::getGroupPerms(perms_prefix));
    1.85 +			body["everyone_mask"] = LLSD::Integer(LLFloaterPerms::getEveryonePerms(perms_prefix));
    1.86  		}
    1.87  		
    1.88  		LLHTTPClient::post(url, body, new FSAssetResponder(body, new_asset_id, asset_type, data));

mercurial