mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix: attachment collection permission (#4470)
This commit is contained in:
parent
0dd3ea8d2e
commit
aa1ed6737d
@ -116,7 +116,7 @@ export interface CollectionOptions extends Omit<ModelOptions, 'name' | 'hooks'>
|
||||
* - 'user' - collection is from user
|
||||
*/
|
||||
origin?: string;
|
||||
|
||||
asStrategyResource?: boolean;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
|
@ -580,13 +580,13 @@ export class PluginACLServer extends Plugin {
|
||||
);
|
||||
|
||||
this.db.on('afterUpdateCollection', async (collection) => {
|
||||
if (collection.options.loadedFromCollectionManager) {
|
||||
if (collection.options.loadedFromCollectionManager || collection.options.asStrategyResource) {
|
||||
this.app.acl.appendStrategyResource(collection.name);
|
||||
}
|
||||
});
|
||||
|
||||
this.db.on('afterDefineCollection', async (collection) => {
|
||||
if (collection.options.loadedFromCollectionManager) {
|
||||
if (collection.options.loadedFromCollectionManager || collection.options.asStrategyResource) {
|
||||
this.app.acl.appendStrategyResource(collection.name);
|
||||
}
|
||||
});
|
||||
|
@ -13,6 +13,7 @@ export default defineCollection({
|
||||
dumpRules: {
|
||||
group: 'user',
|
||||
},
|
||||
asStrategyResource: true,
|
||||
shared: true,
|
||||
name: 'attachments',
|
||||
createdBy: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user