UI中的未经授权的操作是否被隐藏,禁用或导致错误? [英] Should unauthorized actions in the UI be hidden, disabled, or result in an error?

查看:310
本文介绍了UI中的未经授权的操作是否被隐藏,禁用或导致错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我来说,这是一个常年问题,我从来没有真正解决过,所以我希望你的意见。如果我知道用户由于权限不足或对象状态不能执行的操作,那么这些操作的UI元素是否可以从用户隐藏,可见但是被禁用或可见,如果尝试会导致错误?你的答案的理由是什么?如果禁用,你会传达原因,如果是这样,怎么样?



这是一个Web界面,所以我已经知道我需要检查传入的帖子/获取对于权限和处理错误,无论如何。我主要在谈论如何处理UI。



这与关于禁用或隐藏菜单项的规则,尽管我对所有类型的UI元素不仅仅是菜单感兴趣。



示例:


  1. 我有一个新页面,允许用户创建一个新的事件。事件可以是主事件或子事件。创建主事件需要EditMasterEvent权限,而创建子事件只需要EditEvent权限。我有一个下拉菜单,允许一个选择一个现有的事件作为父(主事件)或没有父(这是一个主事件)。如果用户只具有EditEvent权限,则应该在下拉列表中显示创建主事件选项,否则忽略。


  2. 删除事件需要您应用程序管理员或具有适用于事件类型的编辑权限。在后一种情况下,事件也必须超过5岁。删除事件导致系统中相关数据的主要级联删除,并且出于合法原因,此数据必须在事件发生后至少5年内保存。由于此操作对于普通用户来说很少见,所以典型的情况是该操作不可用。是否应该总是显示或仅在实际可能时显示?



解决方案

几乎所有的UI问题,答案是依赖。



您需要权衡用户满意度的可发现性等等。例如,允许无效的操作可以让您有机会解释为什么无效。如果为什么这个残疾人的答案不明显,这是特别有用的。对于大多数用户是初学者的应用程序,这很重要。



另一方面,看到控件,点击它可能会非常令人沮丧,只能以抱歉,您现在不能这样做 信息。几年前我继承的应用程序充满了这种东西,它使用UI来挫败了一个练习。



完全隐藏的功能很少是一个好主意。想象一下,知道一些功能有一分钟前,但现在已经走了。无论是菜单项还是工具栏按钮或其他完整的按钮,使其隐藏可能是对最终用户的沮丧操作。



尝试进行一些可用性测试,如果只是问下一个人你看到嘿,禁用这个或给你一个内容丰富的对话是有意义的。只有另外一个意见通常足以使您从另一个方向看待问题。



底线:做最好的用户服务。您提到的所有情况在某些情况下都是有效的。与所有UI问题一样,向自己(或更好地,您的用户)询问最适合他们的需求。


This is a perennial question for me that I've never really resolved so I'd like your input. If I have actions that I know a user will not be able to perform due to insufficient privileges or object state, should the UI elements for those actions be hidden from the user, visible but disabled, or visible and result in an error if attempted? What would be the rationale for your answer? If disabled, would you communicate the reason why and, if so, how?

This is a web interface so I already know that I need to check the incoming post/get for permissions and handle errors there anyway. I'm primarily talking about how to handle the UI.

This is similar to Rules about disabling or hiding menu items, though I am interested in all types of UI elements not just menus.

Examples:

  1. I have a New page that allows a user to create a new Event. Events can be master events or subevents. Creating a master event requires "EditMasterEvent" privilege, while creating a subevent requires only "EditEvent" privilege. I have a drop down that allows one to choose an existing event as the parent (master event) or no parent (this is a master event). Should the "Create Master Event" choice be shown on the dropdown or omitted if the user only has "EditEvent" privileges.

  2. Deleting events requires that you be an application administrator or have the appropriate edit permission for the event type. In the latter case, the event must also be more than 5 years old. Deleting an event causes major cascading deletes of related data in the system and for legal reasons this data must be kept for at least 5 years after the event. Since this operation is rare for the normal user, the typical case is that the action is not available. Should it be shown always or only when actually possible?

解决方案

As with nearly all UI questions, the answer is "it depends".

You need to weigh discoverability with user satisfaction, among other things. For example, allowing an invalid action gives you an opportunity to explain why something is invalid. This is particularly useful if the answer to "why is this disabled" isn't obvious. For an application where most users are beginners, that's important.

On the other hand, it can be mightily frustrating to see a control, click on it, only to be rewarded with a "sorry, you can't do that now" message. An app I inherited a couple years back was rife with that sort of stuff and it made using the UI an exercise in frustration.

Completely hiding functionality is probably rarely a good idea. Imagine knowing some feature "was there a minute ago" but now it's gone. Whether it's a menu item or a toolbar button or something else entirely, making it hidden can be an exercise in frustration for the end user.

Try doing a little usability testing, if only by asking the next person you see "hey, does it make sense to disable this or show you an informative dialog". Just one other opinion is often enough to get you to look at the problem from another direction.

Bottom line: do what best serves the user. All the scenarios you mention are valid under certain circumstances. As with all UI questions, ask yourself (or better, your users) what best serves their needs.

这篇关于UI中的未经授权的操作是否被隐藏,禁用或导致错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆