# file-manager-access-control

> File manager sample with document access rules, role filters, and user-based navigation.

**Framework:** javascript  **Component:** FileManager  **Variant:** access-control

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/javascript/file-manager-access-control.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-filemanager
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/file-manager-access-control/file-manager.html

```html
<div class="control-section">
            <div id="container" ></div>
</div>
<style>
    .fileupload {
        max-width: 500px;
        margin: auto;
    }
    #openBtn {
        position: absolute;
        top: 34px;
        left: 43%;
    }
    #target {
        height: 550px;
    }
    #dialog {
        top: 20px !important;
        max-height: 500px !important;
    }
    .fileupload .e-file-drop, .fileupload .e-css.e-btn {
        display: none;
    }
    
    .tailwind #openBtn,
	.tailwind-dark #openBtn {
		top: 29px;
	}
	
    .bootstrap #openBtn,
    .bootstrap-dark #openBtn {
        top: 30px;
    }
	.bootstrap5 #openBtn,
    .bootstrap5-dark #openBtn {
        top: 26px;
    }

</style>
```

### src/components/file-manager-access-control/file-manager.ts

```typescript
import { FileManager, Toolbar, NavigationPane, DetailsView } from '@syncfusion/ej2-filemanager';

FileManager.Inject(Toolbar, NavigationPane, DetailsView);

/**
 * File Manager real time use case sample
 */

export function initFileManagerAccessControl(): void {

    let hostUrl: string = 'https://physical-service.syncfusion.com/';

    // Initialize the FileManager component
    let filemanagerInstance: FileManager = new FileManager({
        ajaxSettings: {
            url: hostUrl + 'api/FileManagerAccess/FileOperations',
            uploadUrl: hostUrl + 'api/FileManagerAccess/Upload',
            downloadUrl: hostUrl + 'api/FileManagerAccess/Download',
            getImageUrl: hostUrl + 'api/FileManagerAccess/GetImage'
        },
        toolbarSettings: { items: ['NewFolder', 'SortBy', 'Cut', 'Copy', 'Paste', 'Delete', 'Refresh', 'Download', 'Rename', 'Selection', 'View', 'Details'] },
        uploadSettings: { directoryUpload: true },
    });
    filemanagerInstance.appendTo('#container');
}

```
