Thanks it works
Now can we get this component to restrict to subscriber groups ![]()
Only way I can do it myself is making Trust Level 3 impossible to get to by increasing the number of days, etc. And then manually adding people when they subscribe. Which is most likely the route I will take unless I can modify this by group.
Restrict Uploads is now blocking the ability to upload at all on new post or replies.
That’s right, sorry.
It looks like this._super() doesn’t actually report whether the user is allowed to upload images in core. I had reused it from the old component, and I already noticed yesterday that it caused issues with the placeholder logic as well.
I don’t have time to dig deeper into this right now.
One thing I noticed while testing today: using "*" in api.addComposerUploadHandler(["*"] breaks the regex used for matching upload handlers.
I think this seems like it should be a part of core. Just my humble opinion but a way of controlling uploads by trust level, group or even individual users would be very useful.
I believe you need to use the subclass method to overwrite this computed descriptor correctly.
import discourseComputed from "discourse-common/utils/decorators";
api.modifyClass("service:composer",
(SuperClass) => class extends SuperClass {
@discourseComputed
allowUpload() {
return super.allowUpload && canUpload;
}
}
);
EDIT:
Made a PR:
https://github.com/tshenry/discourse-restrict-uploads/pull/4
I created a pull request which switches the component from trust level-based to group-based restrictions:
https://github.com/tshenry/discourse-restrict-uploads/pull/6
@tshenry 컴포넌트를 그룹 기반으로 작동하도록 변경하는 데 관심이 있으신가요?
테마의 그룹 설정에 대한 코어의 변경 사항을 반영하기 위해 이제 변경 사항을 조정해야 할 가능성이 높습니다. 하지만 원치 않으시는 경우, 업데이트에 시간을 들이지 않아도 됩니다.
@Moin 그룹 설정 변경 사항에 대해 언급하신 것으로 추정되는 부분에 대해 PR에 댓글을 남겼습니다. 이 작업에 계속 관심이 있으시다면 업데이트를 푸시해 주십시오. 현재 테스트 사이트에 PR 브랜치를 설정해 두었으므로, 이 작업을 진행하는 데 도움을 드릴 수 있을 것입니다.
