You can implement this as follows:
First, add an authentication filter to authenticate a user. Refer this: https://spark.apache.org/docs/latest/configuration.html#spark-ui
If you don't install the filter then this won't work.
Next, enable Access Control Lists like this:
val sc = new SparkContext(new SparkConf())
./bin/spark-submit <all your existing options> --spark.acls.enable=true