良好的Restful设计:相同url的不同帐户具有不同的负载

良好的Restful设计:相同url的不同帐户具有不同的负载,rest,restful-authentication,basic-authentication,payload,Rest,Restful Authentication,Basic Authentication,Payload,如果一个url根据所使用的基本身份验证接受不同的有效负载,是否会被认为是糟糕的设计?例如: http://localhost/userA PUT by userA is allowed up pass XML_A but http://localhost/userA PUT by adminA is allowed up pass XML_B which is XML_A plus more. 换句话说,它是相同的资源,但可以更新的内容是根据提供的凭据确定的 我看到过关于返回数据的对话,但没

如果一个url根据所使用的基本身份验证接受不同的有效负载,是否会被认为是糟糕的设计?例如:

http://localhost/userA PUT by userA is allowed up pass XML_A but

http://localhost/userA PUT by adminA is allowed up pass XML_B which is XML_A plus more.
换句话说,它是相同的资源,但可以更新的内容是根据提供的凭据确定的

我看到过关于返回数据的对话,但没有太多关于请求有效负载的对话。(不确定是否会被视为不同)谢谢

更新

根据Darrel Miller的信息,下面的设计会更好吗

GET /{Username}       readonly resource returns different payload based off of rights
GET /{Username}/UpdInfo  returns only updatable info (subset of GET /{Username})
PUT /{Username}/UpdInfo  updates info 1 to 1 from the GET /{Username}/Info

GET /admin/{Username}/UpdInfo returns updatable info (larger subset of GET /{Username})
PUT /admin/{Username}/UpdInfo updates info 1 to 1 from the GET /admin/{Username}/Info

我看到的问题是PUT方法替换了目标资源的全部内容。e、 g如果发生以下顺序

PUT /UserA  with  XML_B

PUT /UserA with XML_A

GET /UserA returns XML_A
UserA不再包含XML_B中包含的额外信息

我认为您最好将两组不同的信息表示为不同的资源:

GET /admin/UserA

PUT /admin/UserA with XML_B

GET /UserA

PUT /UserA with XML_A

隐马尔可夫模型。。我唯一的困惑是XML_B源于XML_A。所以我的想法是UserA访问GET/UserA,看到XML_A的变化,并将/UserA与XML_A放在一起。AdminA过来,看到了GET/UserA,看到了XML_B(即XML_A加上一些额外字段),并将/UserA与XML_B放在一起。如果UserA调用GET/UserA,他们将看到XML_A(这是XML_B,但“浇铸”到XML_A,这是受限视图)。我用另一个url布局更新了我的问题。请让我知道你的想法