Skip to content

Commit bcc5faf

Browse files
Merge pull request #14695 from nextcloud/feature/use-default-sharing-permissions
Feature - Use default sharing permissions
2 parents 420d572 + e36a0d5 commit bcc5faf

File tree

8 files changed

+1381
-4
lines changed

8 files changed

+1381
-4
lines changed

app/schemas/com.nextcloud.client.database.NextcloudDatabase/88.json

Lines changed: 1343 additions & 0 deletions
Large diffs are not rendered by default.

app/src/main/java/com/nextcloud/client/database/NextcloudDatabase.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ import com.owncloud.android.db.ProviderMeta
7070
AutoMigration(from = 83, to = 84),
7171
AutoMigration(from = 84, to = 85, spec = DatabaseMigrationUtil.DeleteColumnSpec::class),
7272
AutoMigration(from = 85, to = 86, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class),
73-
AutoMigration(from = 86, to = 87, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class)
73+
AutoMigration(from = 86, to = 87, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class),
74+
AutoMigration(from = 87, to = 88, spec = DatabaseMigrationUtil.ResetCapabilitiesPostMigration::class)
7475
],
7576
exportSchema = true
7677
)

app/src/main/java/com/nextcloud/client/database/entity/CapabilityEntity.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,7 @@ data class CapabilityEntity(
138138
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_RECOMMENDATION)
139139
val recommendation: Int?,
140140
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_NOTES_FOLDER_PATH)
141-
val notesFolderPath: String?
141+
val notesFolderPath: String?,
142+
@ColumnInfo(name = ProviderTableMeta.CAPABILITIES_DEFAULT_PERMISSIONS)
143+
val defaultPermissions: Int?
142144
)

app/src/main/java/com/owncloud/android/datamodel/FileDataStorageManager.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,6 +2317,8 @@ private ContentValues createContentValues(String accountName, OCCapability capab
23172317

23182318
contentValues.put(ProviderTableMeta.CAPABILITIES_NOTES_FOLDER_PATH, capability.getNotesFolderPath());
23192319

2320+
contentValues.put(ProviderTableMeta.CAPABILITIES_DEFAULT_PERMISSIONS, capability.getDefaultPermissions());
2321+
23202322
return contentValues;
23212323
}
23222324

@@ -2496,6 +2498,8 @@ private OCCapability createCapabilityInstance(Cursor cursor) {
24962498
capability.setRecommendations(getBoolean(cursor, ProviderTableMeta.CAPABILITIES_RECOMMENDATION));
24972499

24982500
capability.setNotesFolderPath(getString(cursor, ProviderTableMeta.CAPABILITIES_NOTES_FOLDER_PATH));
2501+
2502+
capability.setDefaultPermissions(getInt(cursor, ProviderTableMeta.CAPABILITIES_DEFAULT_PERMISSIONS));
24992503
}
25002504

25012505
return capability;

app/src/main/java/com/owncloud/android/db/ProviderMeta.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626
public class ProviderMeta {
2727
public static final String DB_NAME = "filelist";
28-
public static final int DB_VERSION = 87;
28+
public static final int DB_VERSION = 88;
2929

3030
private ProviderMeta() {
3131
// No instance
@@ -273,6 +273,7 @@ static public class ProviderTableMeta implements BaseColumns {
273273
public static final String CAPABILITIES_FILES_DOWNLOAD_LIMIT = "files_download_limit";
274274
public static final String CAPABILITIES_FILES_DOWNLOAD_LIMIT_DEFAULT = "files_download_limit_default";
275275
public static final String CAPABILITIES_NOTES_FOLDER_PATH = "notes_folder_path";
276+
public static final String CAPABILITIES_DEFAULT_PERMISSIONS = "default_permissions";
276277

277278
//Columns of Uploads table
278279
public static final String UPLOADS_LOCAL_PATH = "local_path";

app/src/main/java/com/owncloud/android/ui/fragment/FileDetailsSharingProcessFragment.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ class FileDetailsSharingProcessFragment :
169169
capabilities = CapabilityUtils.getCapability(context)
170170

171171
requireNotNull(fileActivity) { "FileActivity may not be null" }
172+
173+
permission = capabilities.defaultPermissions ?: OCShare.NO_PERMISSION
172174
}
173175

174176
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
buildscript {
1212
ext {
13-
androidLibraryVersion ="766e7b818cace55031c010d949645b991dd340e0"
13+
androidLibraryVersion ="4e47b7649d224217830101779e37add5344a3805"
1414
androidCommonLibraryVersion = "0.25.0"
1515
androidPluginVersion = "8.9.0"
1616
androidxMediaVersion = "1.5.1"

gradle/verification-metadata.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9893,6 +9893,14 @@
98939893
<sha256 value="fc987eaf53cefe50c60453d32727bb23bb1818eb4898ef89abce4d001c0f87c5" origin="Generated by Gradle" reason="Artifact is not signed"/>
98949894
</artifact>
98959895
</component>
9896+
<component group="com.github.nextcloud" name="android-library" version="0bc996e6b6">
9897+
<artifact name="android-library-0bc996e6b6.aar">
9898+
<sha256 value="944bc1de6496e567dd53573007a81102788f869d6ad83f6690f3cb4a156e1280" origin="Generated by Gradle" reason="Artifact is not signed"/>
9899+
</artifact>
9900+
<artifact name="android-library-0bc996e6b6.module">
9901+
<sha256 value="e49e3446832e8832a399435b423c5145ee0ac0a1cc790606ebb32efbf9f993e2" origin="Generated by Gradle" reason="Artifact is not signed"/>
9902+
</artifact>
9903+
</component>
98969904
<component group="com.github.nextcloud" name="android-library" version="0c886d61f6">
98979905
<artifact name="android-library-0c886d61f6.aar">
98989906
<sha256 value="9c3a87487717acd878305a00f0d6f2337b9f5512d541f7ac46b9bdb5a53020b9" origin="Generated by Gradle" reason="Artifact is not signed"/>
@@ -10029,6 +10037,22 @@
1002910037
<sha256 value="faaf14410c3697725f5a5908474d716099c272101924179c5c55b6419cd2fbc9" origin="Generated by Gradle" reason="Artifact is not signed"/>
1003010038
</artifact>
1003110039
</component>
10040+
<component group="com.github.nextcloud" name="android-library" version="4e47b7649d">
10041+
<artifact name="android-library-4e47b7649d.aar">
10042+
<sha256 value="58af3e5dc59290e8c17da6a8300689f086e9b3f8c2865042b23814cf8671a3c3" origin="Generated by Gradle" reason="Artifact is not signed"/>
10043+
</artifact>
10044+
<artifact name="android-library-4e47b7649d.module">
10045+
<sha256 value="014a9a3437f0200d3ad8753a4e7524dd11dd3e9688c01bd0a579b82af3c2de21" origin="Generated by Gradle" reason="Artifact is not signed"/>
10046+
</artifact>
10047+
</component>
10048+
<component group="com.github.nextcloud" name="android-library" version="4e47b7649d224217830101779e37add5344a3805">
10049+
<artifact name="android-library-4e47b7649d224217830101779e37add5344a3805.aar">
10050+
<sha256 value="58af3e5dc59290e8c17da6a8300689f086e9b3f8c2865042b23814cf8671a3c3" origin="Generated by Gradle" reason="Artifact is not signed"/>
10051+
</artifact>
10052+
<artifact name="android-library-4e47b7649d224217830101779e37add5344a3805.module">
10053+
<sha256 value="73bf20a162d85d2962489b53591f18adc4d38f1589ca9409f4dbe3654a9c05f4" origin="Generated by Gradle" reason="Artifact is not signed"/>
10054+
</artifact>
10055+
</component>
1003210056
<component group="com.github.nextcloud" name="android-library" version="55a8c0532461d0742f81c8593f4807e9ba727b9e">
1003310057
<artifact name="android-library-55a8c0532461d0742f81c8593f4807e9ba727b9e.aar">
1003410058
<sha256 value="7b1c45e5af11857cf1e18d4d4a9347d97b253426f6cad5956c5da058587286a0" origin="Generated by Gradle" reason="Artifact is not signed"/>

0 commit comments

Comments
 (0)