Disable the user home folder creation

2020-04-21 04:04发布

When the admin user create the user, I customize the code to switch on and off "homeFolderCreationEager" but it can only delay the creation of the folder. When the corresponding user logs in, the folder for that user is automatically created.

How can I prevent this from happening ? Any kind help is appreciated.

标签: java alfresco
4条回答
闹够了就滚
2楼-- · 2020-04-21 04:40

As stated in the wiki, you can configure the users to share the Company Home space. If you're using LDAP synchronization, you can configure it with

ldap.synchronization.defaultHomeFolderProvider=companyHomeFolderProvider

Otherwise you need to overrule the default Spring configuration and define the following bean (the name attribute is of course important as you need to override default configurations):

<bean name="homeFolderManager" class="org.alfresco.repo.security.person.HomeFolderManager" init-method="init">
    <property name="nodeService">
        <ref bean="nodeService" />
    </property>
    <property name="policyComponent">
        <ref bean="policyComponent" />
    </property>
    <property name="defaultProvider">
        <!-- here's the custom part: -->
        <ref bean="companyHomeFolderProvider" />
    </property>
    <property name="enableHomeFolderCreationAsPeopleAreCreated">
        <value>${home.folder.creation.eager}</value>
    </property>
</bean>

There are other default providers available, have a look at authentication-services-context.xml for more.

查看更多
成全新的幸福
3楼-- · 2020-04-21 04:44

Hi Every user has a 'home folder' this is a location to an existing space and if no one is supplied it will create an home folder.

You can see this very clearly by connecting an AD/LDAP to Alfresco, there you can supply the home folder. Hence you don't need to disable the homefoldercreation, you need to supply homefolder = app:company or something.

So you need to find out where this property is and how you can set it. Then you wont have this problem.

查看更多
劫难
4楼-- · 2020-04-21 04:56

I studied the source and found that

getHomeFolder method of class PortableHomeFolderManager class create the folder automatically.

So I commented out that part and return home space node like following

            homeSpaceNodeRef = new HomeSpaceNodeRef(getRootPathNodeRef(provider),
                    HomeSpaceNodeRef.Status.REFERENCED);
            return homeSpaceNodeRef;
           //fileInfo = createTree(provider, getRootPathNodeRef(provider), homeFolderPath,provider.getTemplateNodeRef(), fileFolderService);
查看更多
虎瘦雄心在
5楼-- · 2020-04-21 05:03
# Create home folders (unless disabled, see next property) as people are created (true) or create them lazily (false)
home.folder.creation.eager=true
# Disable home folder creation - if true then home folders are not created (neither eagerly nor lazily
home.folder.creation.disabled=false

Use the second property to disable home folder creation completely. The properties are meant to be static and system-wide.

If you want to fine-tune the creation according to some other logic, you can wire in your own homeFolderManager bean.

查看更多
登录 后发表回答