Skip to content

Showing Relationship Resource data in Dropdown even though user doesn't have permission to view the relationship resource #4472

@benittobeny34

Description

@benittobeny34

example:
I have a party nova resource the fields are
`
public function fields(Request $request)
{
return [
ID::make()->sortable()->hideFromDetail()->hideFromIndex(),

        Text::make('Name')
            ->sortable()
            ->rules('required', 'max:255'),

        Text::make('Phone Number')
            ->sortable()->hideFromIndex(),

        Textarea::make('Address')
            ->sortable()->hideFromIndex(),

        BelongsTo::make('Department')->sortable(),

        BelongsTo::make('Head')->sortable(),

        Date::make('Created At')
            ->sortable()
            ->exceptOnForms()
            ->format('DD.MM.YYYY'),
    ];
}

`

here user doesn't have permission to view head and department resource those policy viewany method returning false, but user have permission to view, create, edit and delete for Party resource.
when opening party page it doesn't show up the department and head fields in the parties master.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions